From 88e7a82140cbdf5a20c49c4fbaffb13e808c624e Mon Sep 17 00:00:00 2001 From: Emmanuel Quentin Date: Sun, 1 Dec 2019 15:48:15 -0500 Subject: [PATCH] Add a check for INStartCallIntent.callCapability not available on iOS 13.2 --- ios/RNCallKeep/RNCallKeep.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ios/RNCallKeep/RNCallKeep.m b/ios/RNCallKeep/RNCallKeep.m index 0fe8061a..8fff36fb 100644 --- a/ios/RNCallKeep/RNCallKeep.m +++ b/ios/RNCallKeep/RNCallKeep.m @@ -471,8 +471,14 @@ + (BOOL)application:(UIApplication *)application // iOS 13 returns an INStartCallIntent userActivity type if (@available(iOS 13, *)) { INStartCallIntent *intent = (INStartCallIntent*)interaction.intent; - isAudioCall = intent.callCapability == INCallCapabilityAudioCall; - isVideoCall = intent.callCapability == INCallCapabilityVideoCall; + // callCapability is not available on iOS > 13.2, but it is in 13.1 weirdly... + if ([intent respondsToSelector:@selector(callCapability)]) { + isAudioCall = intent.callCapability == INCallCapabilityAudioCall; + isVideoCall = intent.callCapability == INCallCapabilityVideoCall; + } else { + isAudioCall = [userActivity.activityType isEqualToString:INStartAudioCallIntentIdentifier]; + isVideoCall = [userActivity.activityType isEqualToString:INStartVideoCallIntentIdentifier]; + } } else { #endif //XCode 10 and below