1.0.4 • Published 6 years ago

react-native-audio-detection v1.0.4

Weekly downloads
16
License
-
Repository
-
Last release
6 years ago

react-native-audio-detection

Getting started

$ npm install react-native-audio-detection --save

Mostly automatic installation

$ react-native link react-native-audio-detection

Important Installation Step For Android

The line of code below should be added to AndroidManifest.xml for the audio jack listener to work.

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

Usage

import AudioJackManager from 'react-native-audio-detection';

// 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();
1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.0

6 years ago