UNPKG

react-native-headphone-detect-v2

Version:

This library is ported from the legacy react-native-headphone-detection library with support for the latest version of Android/iOS SDK, and Typescript intellisense.

12 lines (11 loc) 493 B
"use strict"; import HeadphoneDetectV2, { AUDIO_DEVICE_CHANGED_NOTIFICATION } from "./NativeHeadphoneDetectV2.js"; import { NativeEventEmitter } from 'react-native'; const eventEmitter = new NativeEventEmitter(HeadphoneDetectV2); export function isAudioDeviceConnected() { return HeadphoneDetectV2.isAudioDeviceConnected(); } export function onAudioDeviceChanged(callback) { return eventEmitter.addListener(AUDIO_DEVICE_CHANGED_NOTIFICATION, callback); } //# sourceMappingURL=index.js.map