react-native link react-native-callkeep
Include in a Podfile in your react-native ios
directory:
pod 'RNCallKeep', :path => '../node_modules/react-native-callkeep'
Then:
cd ios
pod install
1.1. In Xcode: Right click Libraries
➜ Add Files to [Your project name]
.
1.2. Choose node_modules/react-native-callkeep/ios/RNCallKeep.xcodeproj
then click Add
.
You'll now have the Library included.
2.1. Click on Build Phases
tab, then open Link Binary With Libraries
.
2.2. Add libRNCallKeep.a
.
1.1. Click on Build Phases
tab, then open Link Binary With Libraries
.
1.2. Add CallKit.framework
and Intents.framework
(and mark it Optional
).
2.1. Click on Build Settings
tab, then search for Header Search Paths
.
2.2. Add $(SRCROOT)/../node_modules/react-native-callkeep/ios/RNCallKeep
.
3.1. Open Info.plist
file and add voip
in UIBackgroundModes
.
By editing this file with a text editor, your should see:
<key>UIBackgroundModes</key>
<array>
<string>voip</string>
</array>
4.1. Import Library:
+ #import "RNCallKeep.h"
4.2. Handling User Activity.
This delegate will be called when the user tries to start a call from native Phone App.
Add it before the @end
tag.
+ - (BOOL)application:(UIApplication *)application
+ continueUserActivity:(NSUserActivity *)userActivity
+ restorationHandler:(void(^)(NSArray<id<UIUserActivityRestoring>> * __nullable restorableObjects))restorationHandler
+ {
+ return [RNCallKeep application:application
+ continueUserActivity:userActivity
+ restorationHandler:restorationHandler];
+ }