You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the below pattern (1.) per the docs, but the 'WiredHeadset' event doesn't seem to be firing on iOS. I also tried with NativeEventEmitter (doing this by using NativeModules to get the InCallManager then wrapping it in NativeEventEmitter, see 2.). I'm on version 0.53 of RN.
import { DeviceEventEmitter } from 'react-native';
DeviceEventEmitter.addListener('WiredHeadset', function (data) {
// --- do something with events
});
const InCallManagerEvent = new NativeEventEmitter(NativeModules.InCallManager)
The text was updated successfully, but these errors were encountered:
import {
NativeModules,
NativeEventEmitter,
} from 'react-native';
const nativeBridge = NativeModules.InCallManager;
const NativeModule = new NativeEventEmitter(nativeBridge);
this.wiredHeadsetListener = NativeModule.addListener('WiredHeadset', (data) => {
// do something
});
and i found native code return the array, not like subscribe on README, so not work so for, should be object of [self sendEventWithName:@"WiredHeadset" body:@{}]
I'm using the below pattern (1.) per the docs, but the 'WiredHeadset' event doesn't seem to be firing on iOS. I also tried with
NativeEventEmitter
(doing this by using NativeModules to get the InCallManager then wrapping it in NativeEventEmitter, see 2.). I'm on version 0.53 of RN.const InCallManagerEvent = new NativeEventEmitter(NativeModules.InCallManager)
The text was updated successfully, but these errors were encountered: