Skip to content

Commit 630cf1a

Browse files
author
Kyle Kurz
authored
Merge pull request #36 from sangoma/iOS_13_fix_call_log_calling
Differentiate intent type comparisons for iOS 13
2 parents 4ae5507 + 6df8579 commit 630cf1a

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

ios/RNCallKeep/RNCallKeep.m

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ + (CXProviderConfiguration *)getProviderConfiguration:(NSDictionary*)settings
391391
providerConfiguration.maximumCallsPerCallGroup = 1;
392392
providerConfiguration.supportedHandleTypes = [NSSet setWithObjects:[NSNumber numberWithInteger:CXHandleTypePhoneNumber], nil];
393393
if (settings[@"supportsVideo"]) {
394-
providerConfiguration.supportsVideo = settings[@"supportsVideo"];
394+
providerConfiguration.supportsVideo = [settings[@"supportsVideo"] boolValue];
395395
}
396396
if (settings[@"maximumCallGroups"]) {
397397
providerConfiguration.maximumCallGroups = [settings[@"maximumCallGroups"] integerValue];
@@ -461,8 +461,17 @@ + (BOOL)application:(UIApplication *)application
461461
INInteraction *interaction = userActivity.interaction;
462462
INPerson *contact;
463463
NSString *handle;
464-
BOOL isAudioCall = [userActivity.activityType isEqualToString:INStartAudioCallIntentIdentifier];
465-
BOOL isVideoCall = [userActivity.activityType isEqualToString:INStartVideoCallIntentIdentifier];
464+
BOOL isAudioCall;
465+
BOOL isVideoCall;
466+
// iOS 13 returns an INStartCallIntent userActivity type
467+
if (@available(iOS 13, *)) {
468+
INStartCallIntent *intent = (INStartCallIntent*)interaction.intent;
469+
isAudioCall = intent.callCapability == INCallCapabilityAudioCall;
470+
isVideoCall = intent.callCapability == INCallCapabilityVideoCall;
471+
} else {
472+
isAudioCall = [userActivity.activityType isEqualToString:INStartAudioCallIntentIdentifier];
473+
isVideoCall = [userActivity.activityType isEqualToString:INStartVideoCallIntentIdentifier];
474+
}
466475

467476
if (isAudioCall) {
468477
INStartAudioCallIntent *startAudioCallIntent = (INStartAudioCallIntent *)interaction.intent;

0 commit comments

Comments
 (0)