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 =>
43
43
const didPerformSetMutedCallAction = handler =>
44
44
eventEmitter . addListener ( RNCallKeepDidPerformSetMutedCallAction , ( data ) => handler ( data . muted ) ) ;
45
45
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 ;
51
49
52
- eventEmitter . addListener ( RNCallKeepDidPerformDTMFAction , handler ) ;
53
- } ;
50
+ return handler ( payload ) ;
51
+ } ) ;
54
52
55
53
export const listeners = {
56
54
didReceiveStartCallAction,
Original file line number Diff line number Diff line change 24
24
static NSString *const RNCallKeepDidActivateAudioSession = @" RNCallKeepDidActivateAudioSession" ;
25
25
static NSString *const RNCallKeepDidDisplayIncomingCall = @" RNCallKeepDidDisplayIncomingCall" ;
26
26
static NSString *const RNCallKeepDidPerformSetMutedCallAction = @" RNCallKeepDidPerformSetMutedCallAction" ;
27
+ static NSString *const RNCallKeepPerformPlayDTMFCallAction = @" RNCallKeepDidPerformDTMFAction" ;
27
28
28
29
@implementation RNCallKeep
29
30
{
@@ -67,7 +68,8 @@ - (void)dealloc
67
68
RNCallKeepPerformEndCallAction,
68
69
RNCallKeepDidActivateAudioSession,
69
70
RNCallKeepDidDisplayIncomingCall,
70
- RNCallKeepDidPerformSetMutedCallAction
71
+ RNCallKeepDidPerformSetMutedCallAction,
72
+ RNCallKeepPerformPlayDTMFCallAction
71
73
];
72
74
}
73
75
@@ -453,6 +455,15 @@ - (void)provider:(CXProvider *)provider performSetHeldCallAction:(CXSetHeldCallA
453
455
#endif
454
456
}
455
457
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
+
456
467
- (void )provider : (CXProvider *)provider timedOutPerformingAction : (CXAction *)action
457
468
{
458
469
#ifdef DEBUG
You can’t perform that action at this time.
0 commit comments