Let's integrate our UIKIT in few minutes
#
Call Setup#
Call UIKit setup in AndroidStep 1: Download the below zip file and extract. Copy all the files inside the extracted folder
and paste it inside project/android/app/src/main/java/com/[packageName]
. After pasted all the files add the MFModule in
MainApplication.java
file as mentioned in the below code snippet.
Step 2: Update the package name in the first line of all the pasted files (extracted files from the zip) to your app package name/folder name as mentioned below.
Step 3: Add the below permissions in android/app/src/main/AndroidManifest.xml
file.
Step 4: Open android/app/src/main/AndroidManifest.xml
file and add the below intent-filter inside MainActivity tag as mentioned below
Note: replace
[your_scheme]
with the scheme name you want for your application.
Step 5: Add the call screen activity code after the main activity as below code in android/app/src/main/AndroidManifest.xml
file.
Step 6: Download the below asset file zip and extract. Copy the ic_call_notification.png
& ic_notification.png
& ic_video_call.png
files and paste it
inside android/app/src/main/res/drawable/
folder. Copy the fly_reconnecting_tone.mp3
& incallmanager_ringback.mp3
files and paste it
inside android/app/src/main/res/raw/
folder.
#
Call UIKit setup in iOSStep 1: Add the microphone and camera permission code in Info.plist
file as below.
Note :Click here to check if you have already declared information in the Notification Configuration. After configuring this, only the CallKit will work. If you have already done so, please disregard this message.
Step: 2 Download the provided module file ZIP, extract its contents, open your iOS project workspace in Xcode, right-click on your project directory, select Add files into [your_project] (or drag the files into your project directory), Select the extracted files, check the copy file if needed checkbox, And then click Ok.
Step: 3 Download the provided asset file ZIP, extract its contents, open your iOS project workspace in Xcode, right-click on your project directory, select Add files into [your_project] (or drag the files into your project directory), Select the extracted files, check the copy file if needed checkbox, And then click Ok.
#
Call UIKit setup in JSOpen the index.js
file in the root of your project. Import mirrorflyNotificationHandler
and setupCallScreen
from mirrorfly-uikit-react-native package.
Add notification background and foreground event listeners and pass the remoteMessage to the mirrorflyNotificationHandler
. Call the
setupCallScreen
function.
Param Object
Object Properties | Description | Type | Required |
---|---|---|---|
remoteMessage | Message data received from the firebase message listener | Object | true |
apiBaseUrl | API Base URL for Backend | String | true |
licenseKey | Mirrorfly's License Key | String | true |
index.js
.#
Sample code to setup #
Render Mirrorfly componentYou can import the MirrorflyComponent
from mirrorfly-uikit-react-native package. This component will render both chat and call.
You can render the component as mentioned in the code below.
note
You should have called the mirrorflyInitialize
function as mentioned here
before rendering the component
Props for the MirrorflyComponent
component
Arguments | Description | Type | Required |
---|---|---|---|
jid | If you want to show only a specific user's chat screen, then you can pass the jid of the user. | String | false |