File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -44,11 +44,6 @@ const didPerformSetMutedCallAction = handler =>
4444 eventEmitter . addListener ( RNCallKeepDidPerformSetMutedCallAction , ( data ) => handler ( data . muted ) ) ;
4545
4646const didPerformDTMFAction = handler => {
47- // @TODO : handle DTMF on iOS
48- if ( isIOS ) {
49- return ;
50- }
51-
5247 eventEmitter . addListener ( RNCallKeepDidPerformDTMFAction , handler ) ;
5348} ;
5449
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