@@ -179,9 +179,24 @@ + (void)initCallKitProvider {
179
179
handle:(NSString *)handle
180
180
handleType:(NSString *)handleType
181
181
hasVideo:(BOOL )hasVideo
182
- localizedCallerName:(NSString * _Nullable)localizedCallerName)
183
- {
184
- [RNCallKeep reportNewIncomingCall: uuidString handle: handle handleType: handleType hasVideo: hasVideo localizedCallerName: localizedCallerName fromPushKit: NO payload: nil withCompletionHandler: nil ];
182
+ localizedCallerName:(NSString * _Nullable)localizedCallerName
183
+ supportsHolding:(BOOL )supportsHolding
184
+ supportsDTMF:(BOOL )supportsDTMF
185
+ supportsGrouping:(BOOL )supportsGrouping
186
+ supportsUngrouping:(BOOL )supportsUngrouping)
187
+ {
188
+ [RNCallKeep reportNewIncomingCall: uuidString
189
+ handle: handle
190
+ handleType: handleType
191
+ hasVideo: hasVideo
192
+ localizedCallerName: localizedCallerName
193
+ supportsHolding: supportsHolding
194
+ supportsDTMF: supportsDTMF
195
+ supportsGrouping: supportsGrouping
196
+ supportsUngrouping: supportsUngrouping
197
+ fromPushKit: NO
198
+ payload: nil
199
+ withCompletionHandler: nil ];
185
200
}
186
201
187
202
RCT_EXPORT_METHOD (startCall:(NSString *)uuidString
@@ -264,7 +279,7 @@ + (void)initCallKitProvider {
264
279
[RNCallKeep endCallWithUUID: uuidString reason: reason];
265
280
}
266
281
267
- RCT_EXPORT_METHOD (updateDisplay:(NSString *)uuidString :(NSString *)displayName :(NSString *)uri)
282
+ RCT_EXPORT_METHOD (updateDisplay:(NSString *)uuidString :(NSString *)displayName :(NSString *)uri :( NSDictionary *)options )
268
283
{
269
284
#ifdef DEBUG
270
285
NSLog (@" [RNCallKeep][updateDisplay] uuidString = %@ displayName = %@ uri = %@ " , uuidString, displayName, uri);
@@ -274,6 +289,23 @@ + (void)initCallKitProvider {
274
289
CXCallUpdate *callUpdate = [[CXCallUpdate alloc ] init ];
275
290
callUpdate.localizedCallerName = displayName;
276
291
callUpdate.remoteHandle = callHandle;
292
+
293
+ if ([options valueForKey: @" hasVideo" ] != nil ) {
294
+ callUpdate.hasVideo = [RCTConvert BOOL: options[@" hasVideo" ]];
295
+ }
296
+ if ([options valueForKey: @" supportsHolding" ] != nil ) {
297
+ callUpdate.supportsHolding = [RCTConvert BOOL: options[@" supportsHolding" ]];
298
+ }
299
+ if ([options valueForKey: @" supportsDTMF" ] != nil ) {
300
+ callUpdate.supportsDTMF = [RCTConvert BOOL: options[@" supportsDTMF" ]];
301
+ }
302
+ if ([options valueForKey: @" supportsGrouping" ] != nil ) {
303
+ callUpdate.supportsGrouping = [RCTConvert BOOL: options[@" supportsGrouping" ]];
304
+ }
305
+ if ([options valueForKey: @" supportsUngrouping" ] != nil ) {
306
+ callUpdate.supportsUngrouping = [RCTConvert BOOL: options[@" supportsUngrouping" ]];
307
+ }
308
+
277
309
[self .callKeepProvider reportCallWithUUID: uuid updated: callUpdate];
278
310
}
279
311
@@ -390,17 +422,10 @@ + (void)reportNewIncomingCall:(NSString *)uuidString
390
422
handleType : (NSString *)handleType
391
423
hasVideo : (BOOL )hasVideo
392
424
localizedCallerName : (NSString * _Nullable)localizedCallerName
393
- fromPushKit : (BOOL )fromPushKit
394
- payload : (NSDictionary * _Nullable)payload
395
- {
396
- [RNCallKeep reportNewIncomingCall: uuidString handle: handle handleType: handleType hasVideo: hasVideo localizedCallerName: localizedCallerName fromPushKit: fromPushKit payload: payload withCompletionHandler: nil ];
397
- }
398
-
399
- + (void )reportNewIncomingCall : (NSString *)uuidString
400
- handle : (NSString *)handle
401
- handleType : (NSString *)handleType
402
- hasVideo : (BOOL )hasVideo
403
- localizedCallerName : (NSString * _Nullable)localizedCallerName
425
+ supportsHolding : (BOOL )supportsHolding
426
+ supportsDTMF : (BOOL )supportsDTMF
427
+ supportsGrouping : (BOOL )supportsGrouping
428
+ supportsUngrouping : (BOOL )supportsUngrouping
404
429
fromPushKit : (BOOL )fromPushKit
405
430
payload : (NSDictionary * _Nullable)payload
406
431
withCompletionHandler : (void (^_Nullable)(void ))completion
@@ -412,10 +437,10 @@ + (void)reportNewIncomingCall:(NSString *)uuidString
412
437
NSUUID *uuid = [[NSUUID alloc ] initWithUUIDString: uuidString];
413
438
CXCallUpdate *callUpdate = [[CXCallUpdate alloc ] init ];
414
439
callUpdate.remoteHandle = [[CXHandle alloc ] initWithType: _handleType value: handle];
415
- callUpdate.supportsDTMF = YES ;
416
- callUpdate.supportsHolding = YES ;
417
- callUpdate.supportsGrouping = YES ;
418
- callUpdate.supportsUngrouping = YES ;
440
+ callUpdate.supportsHolding = supportsHolding ;
441
+ callUpdate.supportsDTMF = supportsDTMF ;
442
+ callUpdate.supportsGrouping = supportsGrouping ;
443
+ callUpdate.supportsUngrouping = supportsUngrouping ;
419
444
callUpdate.hasVideo = hasVideo;
420
445
callUpdate.localizedCallerName = localizedCallerName;
421
446
@@ -428,6 +453,10 @@ + (void)reportNewIncomingCall:(NSString *)uuidString
428
453
@" handle" : handle,
429
454
@" localizedCallerName" : localizedCallerName ? localizedCallerName : @" " ,
430
455
@" hasVideo" : hasVideo ? @" 1" : @" 0" ,
456
+ @" supportsHolding" : supportsHolding ? @" 1" : @" 0" ,
457
+ @" supportsDTMF" : supportsDTMF ? @" 1" : @" 0" ,
458
+ @" supportsGrouping" : supportsGrouping ? @" 1" : @" 0" ,
459
+ @" supportsUngrouping" : supportsUngrouping ? @" 1" : @" 0" ,
431
460
@" fromPushKit" : fromPushKit ? @" 1" : @" 0" ,
432
461
@" payload" : payload ? payload : @" " ,
433
462
}];
@@ -443,16 +472,6 @@ + (void)reportNewIncomingCall:(NSString *)uuidString
443
472
}];
444
473
}
445
474
446
- + (void )reportNewIncomingCall : (NSString *)uuidString
447
- handle : (NSString *)handle
448
- handleType : (NSString *)handleType
449
- hasVideo : (BOOL )hasVideo
450
- localizedCallerName : (NSString * _Nullable)localizedCallerName
451
- fromPushKit : (BOOL )fromPushKit
452
- {
453
- [RNCallKeep reportNewIncomingCall: uuidString handle: handle handleType: handleType hasVideo: hasVideo localizedCallerName: localizedCallerName fromPushKit: fromPushKit payload: nil withCompletionHandler: nil ];
454
- }
455
-
456
475
- (BOOL )lessThanIos10_2
457
476
{
458
477
if (_version.majorVersion < 10 ) {
0 commit comments