Skip to content

Commit c7bec36

Browse files
author
Brandon Huang
committed
Improve logic to include XCode/sdk version combinations except XCode 10 with iOS 13
1 parent bb45ee9 commit c7bec36

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

ios/RNCallKeep/RNCallKeep.m

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -464,20 +464,24 @@ + (BOOL)application:(UIApplication *)application
464464
BOOL isAudioCall;
465465
BOOL isVideoCall;
466466

467-
//HACK TO AVOID XCODE 10 COMPILE CRASH
468-
//REMOVE ON NEXT MAJOR RELEASE OF RNCALLKIT
467+
//HACK TO AVOID XCODE 10 COMPILE CRASH
468+
//REMOVE ON NEXT MAJOR RELEASE OF RNCALLKIT
469469
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
470470
//XCode 11
471471
// iOS 13 returns an INStartCallIntent userActivity type
472472
if (@available(iOS 13, *)) {
473473
INStartCallIntent *intent = (INStartCallIntent*)interaction.intent;
474474
isAudioCall = intent.callCapability == INCallCapabilityAudioCall;
475475
isVideoCall = intent.callCapability == INCallCapabilityVideoCall;
476+
} else {
477+
#endif
478+
//XCode 10 and below
479+
isAudioCall = [userActivity.activityType isEqualToString:INStartAudioCallIntentIdentifier];
480+
isVideoCall = [userActivity.activityType isEqualToString:INStartVideoCallIntentIdentifier];
481+
//HACK TO AVOID XCODE 10 COMPILE CRASH
482+
//REMOVE ON NEXT MAJOR RELEASE OF RNCALLKIT
483+
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
476484
}
477-
#else
478-
//XCode 10 and below
479-
isAudioCall = [userActivity.activityType isEqualToString:INStartAudioCallIntentIdentifier];
480-
isVideoCall = [userActivity.activityType isEqualToString:INStartVideoCallIntentIdentifier];
481485
#endif
482486

483487
if (isAudioCall) {

0 commit comments

Comments
 (0)