https://github.com/robinpowered/react-native-audio-jack
https://github.com/robinpowered/react-native-audio-jack
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/robinpowered/react-native-audio-jack
- Owner: robinpowered
- Created: 2018-01-02T20:41:44.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-01-23T16:17:30.000Z (over 2 years ago)
- Last Synced: 2025-03-24T04:43:40.152Z (about 1 year ago)
- Language: Java
- Size: 150 KB
- Stars: 10
- Watchers: 26
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-audio-jack
## Getting started
`$ npm install react-native-audio-jack --save`
### Mostly automatic installation
`$ react-native link react-native-audio-jack`
### Important Installation Step For Android
The line of code below should be added to `AndroidManifest.xml` for the audio jack listener to work.
```xml
```
## Usage
```javascript
import AudioJackManager from 'react-native-audio-jack';
// Determine if audio jack is plugged in
AudioJackManager.isPluggedIn().then(isPluggedIn => console.log(isPluggedIn));
// Listener to listen for change in audio jack status
var audioJackListener = AudioJackManager.addListener(({isPluggedIn}) => console.log(isPluggedIn));
// Later on.... (when component unmounts etc)
audioJackListener.remove();
```