File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ const checkReachability = handler =>
5959const didLoadWithEvents = handler =>
6060 eventEmitter . addListener ( RNCallKeepDidLoadWithEvents , handler ) ;
6161
62+ export const emit = ( eventName , payload ) => eventEmitter . emit ( eventName , payload ) ;
63+
6264export const listeners = {
6365 didReceiveStartCallAction,
6466 answerCall,
@@ -71,5 +73,5 @@ export const listeners = {
7173 didPerformDTMFAction,
7274 didResetProvider,
7375 checkReachability,
74- didLoadWithEvents
76+ didLoadWithEvents,
7577} ;
Original file line number Diff line number Diff line change 11import { NativeModules , Platform , Alert } from 'react-native' ;
22
3- import { listeners } from './actions'
3+ import { listeners , emit } from './actions'
44
55const RNCallKeepModule = NativeModules . RNCallKeep ;
66const isIOS = Platform . OS === 'ios' ;
@@ -22,6 +22,12 @@ class RNCallKeep {
2222
2323 constructor ( ) {
2424 this . _callkeepEventHandlers = new Map ( ) ;
25+
26+ this . addEventListener ( 'didLoadWithEvents' , ( events ) => {
27+ events . forEach ( event => {
28+ emit ( evemt . name , event . data ) ;
29+ } ) ;
30+ } ) ;
2531 }
2632
2733 addEventListener = ( type , handler ) => {
Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ @implementation RNCallKeep
4141 BOOL _isStartCallActionEventListenerAdded;
4242 bool _hasListeners;
4343 NSMutableArray *_delayedEvents;
44-
4544}
4645
4746static CXProvider * sharedProvider;
You can’t perform that action at this time.
0 commit comments