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 =>
59
59
const didLoadWithEvents = handler =>
60
60
eventEmitter . addListener ( RNCallKeepDidLoadWithEvents , handler ) ;
61
61
62
+ export const emit = ( eventName , payload ) => eventEmitter . emit ( eventName , payload ) ;
63
+
62
64
export const listeners = {
63
65
didReceiveStartCallAction,
64
66
answerCall,
@@ -71,5 +73,5 @@ export const listeners = {
71
73
didPerformDTMFAction,
72
74
didResetProvider,
73
75
checkReachability,
74
- didLoadWithEvents
76
+ didLoadWithEvents,
75
77
} ;
Original file line number Diff line number Diff line change 1
1
import { NativeModules , Platform , Alert } from 'react-native' ;
2
2
3
- import { listeners } from './actions'
3
+ import { listeners , emit } from './actions'
4
4
5
5
const RNCallKeepModule = NativeModules . RNCallKeep ;
6
6
const isIOS = Platform . OS === 'ios' ;
@@ -22,6 +22,12 @@ class RNCallKeep {
22
22
23
23
constructor ( ) {
24
24
this . _callkeepEventHandlers = new Map ( ) ;
25
+
26
+ this . addEventListener ( 'didLoadWithEvents' , ( events ) => {
27
+ events . forEach ( event => {
28
+ emit ( evemt . name , event . data ) ;
29
+ } ) ;
30
+ } ) ;
25
31
}
26
32
27
33
addEventListener = ( type , handler ) => {
Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ @implementation RNCallKeep
41
41
BOOL _isStartCallActionEventListenerAdded;
42
42
bool _hasListeners;
43
43
NSMutableArray *_delayedEvents;
44
-
45
44
}
46
45
47
46
static CXProvider * sharedProvider;
You can’t perform that action at this time.
0 commit comments