File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -43,14 +43,12 @@ const didDisplayIncomingCall = handler =>
4343const didPerformSetMutedCallAction = handler =>
4444 eventEmitter . addListener ( RNCallKeepDidPerformSetMutedCallAction , ( data ) => handler ( data . muted ) ) ;
4545
46- const didPerformDTMFAction = handler => {
47- // @TODO : handle DTMF on iOS
48- if ( isIOS ) {
49- return ;
50- }
46+ const didPerformDTMFAction = handler =>
47+ eventEmitter . addListener ( RNCallKeepDidPerformDTMFAction , ( data ) => {
48+ const payload = isIOS ? { dtmf : data . digits , callUUID : data . callUUID } : data ;
5149
52- eventEmitter . addListener ( RNCallKeepDidPerformDTMFAction , handler ) ;
53- } ;
50+ return handler ( payload ) ;
51+ } ) ;
5452
5553export const listeners = {
5654 didReceiveStartCallAction,
Original file line number Diff line number Diff line change 2424static NSString *const RNCallKeepDidActivateAudioSession = @" RNCallKeepDidActivateAudioSession" ;
2525static NSString *const RNCallKeepDidDisplayIncomingCall = @" RNCallKeepDidDisplayIncomingCall" ;
2626static NSString *const RNCallKeepDidPerformSetMutedCallAction = @" RNCallKeepDidPerformSetMutedCallAction" ;
27+ static NSString *const RNCallKeepPerformPlayDTMFCallAction = @" RNCallKeepDidPerformDTMFAction" ;
2728
2829@implementation RNCallKeep
2930{
@@ -67,7 +68,8 @@ - (void)dealloc
6768 RNCallKeepPerformEndCallAction,
6869 RNCallKeepDidActivateAudioSession,
6970 RNCallKeepDidDisplayIncomingCall,
70- RNCallKeepDidPerformSetMutedCallAction
71+ RNCallKeepDidPerformSetMutedCallAction,
72+ RNCallKeepPerformPlayDTMFCallAction
7173 ];
7274}
7375
@@ -453,6 +455,15 @@ - (void)provider:(CXProvider *)provider performSetHeldCallAction:(CXSetHeldCallA
453455#endif
454456}
455457
458+ - (void )provider : (CXProvider *)provider performPlayDTMFCallAction : (CXPlayDTMFCallAction *)action {
459+ #ifdef DEBUG
460+ NSLog (@" [RNCallKit][CXProviderDelegate][provider:performPlayDTMFCallAction]" );
461+ #endif
462+ NSString *callUUID = [self containsLowerCaseLetter: action.callUUID.UUIDString] ? action.callUUID .UUIDString : [action.callUUID.UUIDString lowercaseString ];
463+ [self sendEventWithName: RNCallKeepPerformPlayDTMFCallAction body: @{ @" digits" : action.digits , @" callUUID" : callUUID }];
464+ [action fulfill ];
465+ }
466+
456467- (void )provider : (CXProvider *)provider timedOutPerformingAction : (CXAction *)action
457468{
458469#ifdef DEBUG
You can’t perform that action at this time.
0 commit comments