Skip to content

Commit

Permalink
Merge pull request #37 from sangoma/iOS_13_XCode_10_INStartCallIntent…
Browse files Browse the repository at this point in the history
…_fix

Check for XCode version
  • Loading branch information
Kyle Kurz authored Sep 30, 2019
2 parents 630cf1a + c7bec36 commit 78b8ac1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion android/react-native-callkeep.iml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/build/generated/res/rs/debug;file://$MODULE_DIR$/build/generated/res/resValues/debug" />
<option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" />
<option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
<option name="PROJECT_TYPE" value="1" />
</configuration>
Expand Down
11 changes: 11 additions & 0 deletions ios/RNCallKeep/RNCallKeep.m
Original file line number Diff line number Diff line change
Expand Up @@ -463,15 +463,26 @@ + (BOOL)application:(UIApplication *)application
NSString *handle;
BOOL isAudioCall;
BOOL isVideoCall;

//HACK TO AVOID XCODE 10 COMPILE CRASH
//REMOVE ON NEXT MAJOR RELEASE OF RNCALLKIT
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
//XCode 11
// iOS 13 returns an INStartCallIntent userActivity type
if (@available(iOS 13, *)) {
INStartCallIntent *intent = (INStartCallIntent*)interaction.intent;
isAudioCall = intent.callCapability == INCallCapabilityAudioCall;
isVideoCall = intent.callCapability == INCallCapabilityVideoCall;
} else {
#endif
//XCode 10 and below
isAudioCall = [userActivity.activityType isEqualToString:INStartAudioCallIntentIdentifier];
isVideoCall = [userActivity.activityType isEqualToString:INStartVideoCallIntentIdentifier];
//HACK TO AVOID XCODE 10 COMPILE CRASH
//REMOVE ON NEXT MAJOR RELEASE OF RNCALLKIT
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
}
#endif

if (isAudioCall) {
INStartAudioCallIntent *startAudioCallIntent = (INStartAudioCallIntent *)interaction.intent;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-callkeep",
"version": "3.0.3",
"version": "3.0.4",
"description": "iOS 10 CallKit and Android ConnectionService Framework For React Native",
"main": "index.js",
"scripts": {},
Expand Down

0 comments on commit 78b8ac1

Please sign in to comment.