File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -315,26 +315,30 @@ + (BOOL)application:(UIApplication *)application
315
315
INInteraction *interaction = userActivity.interaction ;
316
316
INPerson *contact;
317
317
NSString *handle;
318
-
319
- if ([userActivity.activityType isEqualToString: INStartAudioCallIntentIdentifier] || [userActivity.activityType isEqualToString: INStartVideoCallIntentIdentifier]) {
318
+ BOOL isAudioCall = [userActivity.activityType isEqualToString: INStartAudioCallIntentIdentifier];
319
+ BOOL isVideoCall = [userActivity.activityType isEqualToString: INStartVideoCallIntentIdentifier];
320
+
321
+ if (isAudioCall) {
320
322
INStartAudioCallIntent *startAudioCallIntent = (INStartAudioCallIntent *)interaction.intent ;
321
323
contact = [startAudioCallIntent.contacts firstObject ];
324
+ } else if (isVideoCall) {
325
+ INStartVideoCallIntent *startVideoCallIntent = (INStartVideoCallIntent *)interaction.intent ;
326
+ contact = [startVideoCallIntent.contacts firstObject ];
322
327
}
323
-
328
+
324
329
if (contact != nil ) {
325
330
handle = contact.personHandle .value ;
326
331
}
327
-
332
+
328
333
if (handle != nil && handle.length > 0 ){
329
334
NSDictionary *userInfo = @{
330
- @" handle" : handle,
331
- @" video" : @NO
332
- };
333
-
335
+ @" handle" : handle,
336
+ @" video" : @(isVideoCall)
337
+ };
338
+
334
339
[[NSNotificationCenter defaultCenter ] postNotificationName: RNCallKitHandleStartCallNotification
335
340
object: self
336
341
userInfo: userInfo];
337
-
338
342
return YES ;
339
343
}
340
344
return NO ;
You can’t perform that action at this time.
0 commit comments