Adding video calls to messaging

How to add video call capabilities to the messaging components

Video call SDK dependency

To add video calls capability to the messaging module, add the video call dependency to your app:

yarn add @nabla/react-native-video-call

or

npm install --save @nabla/react-native-video-call

Once done, run pod install in your ios directory, in order to install the native dependencies.

iOS project settings

Few project settings are required before being able to use the video call module on iOS.

Set up camera and microphone usage descriptions

It is mandatory to define some NSMicrophoneUsageDescription and NSCameraUsageDescription before requesting the camera & microphone permissions. Otherwise, your app will crash.

You can define those in your Info.plist file. More info here and there.

Register your app for VOIP background execution

By default, iOS apps are inactive when sent to background. This means that your patients won't be able to hear or speak if they switch to another app while inside a video call.

To prevent this, you must add the UIBackgroundModes key to your Info.plist file, then add a voip item. If done correctly, Xcode should recognize those keys and replace them with human-readable descriptions:

Link to the documentation.

Disable BITCODE for debug builds

We are using the WebRTC library to implement NablaVideoCall. This library does not support BITCODE for debug builds. You must disable it in your Build Settings. Find the Enable Bitcode key, expand it, and set it to no for debug builds.

Set up video call module

The next step is to set up the video call module when you init the NablaClient:

await NablaMessagingClient.initializeMessagingModule();
await NablaVideoCallClient.initializeVideoCallModule();

await NablaClient.getInstance().initialize(new Configuration("YOUR_API_KEY"));

Build and run your app, you should now be able to receive video call CTAs in a conversation and answer them.

Your first video call

Preview of the video callPreview of the video call

From the Nabla Console, a provider can now send a video call CTA that the patient can tap to join the call.

The patient will have to accept the Microphone and Camera permissions and will then be able to join the call.