Let's integrate our UIKIT in few minutes
#
Quick Start#
SDK UIKit for React NativeMirrorfly UIKit Sdk is a set of prebuilt UI components that allows you to easily integrate an in-app chat with all the essential messaging features.
#
RequirementsThe requirements for chat SDK for React Native Mobile App are:
- React Version 17.0 or above
- React-Native 0.69.0 or above
- Node Version v18 or above
#
Things to be Noted Before Making a Start#
SDK License KeyBefore integrating CONTUS MirrorFly Chat SDK, you need to have a SDK license key for your MirrorFly application. This SDK needs to be authenticated by the MirrorFly server using the license key for further processing.
#
To get the License Key,Step 1: Register here to get a MirrorFly User account. Registration is subject to verification and would take up to 24 hours.
Step 2: Login to your Account
Step 3: Get the License key from the application Info
โ section
#
IntegrationInstall mirrorfly-uikit-react-native (https://www.npmjs.com/package/mirrorfly-uikit-react-native) npm package by terminal command 'npm i mirrorfly-uikit-react-native'. Now the node_modules will have a mirrorfly-uikit-react-native folder and package.json is added with the mirrorfly-uikit-react-native dependency.
Step 1: Create a new React Native project or Open an existing project.
#
Adding dependenciesNote : Before installing the patch-package need to download the patch files and paste that files in root folder.
Step 2: Open terminal and install patch-package with npm command 'npm i patch-package -f' and check package.json
whether the dependency is added.
Step 3: After installing the patch-package add the below lines in package.json under scripts
Step 4: Open terminal and install mirrorfly-uikit-react-native with npm command 'npm i mirrorfly-uikit-react-native' and check package.json whether the dependency is added.
Step 5: Open the metro.config.js
and update the code as mentioned below.
Step 6: Install required dependencies enter the following code on the command line for adding the below dependencies in package.Json
.
Note : realm@10.8.0 must use the realm version 10.8.0 in v 0.69.12,
if errors occurs like this >Task :realm:send FAILED
, Add the following line in this file<app>/android/settings.gradle
Note : if errors occurs like this >
could not invoke RNAndroidLocationEnabler.promptForEnableLocationIfNeeded. found interface com.google.android.gms.location.settingsclient, but class was expected (declaration of 'com.google.android.gms.location.SettingsClient' appears in /data/app/~~dQIJYPyV_0zb5PG-2RsSMg==/applicationId-s0 mk9yoRtp0KWm9j-w-wQ==/ base.apk)
,
Add the following line in this file<app>/android/build.gradle
Step 7: Install all the dependencies in terminal
Note: Follow the installation instruction for the @react-native-firebase package
Step 8: You can check here about what are the permissions
.
#
Change Android dependencyStep 9: Add the below lines in android app folder build.gradle
file under android defaultConfig.
Step 10: Change the below lines to your root build.gradle
file in your Android folder.
#
Change iOS dependencyStep 11: Add the below lines in ios app folder Podfile
file under target 'app_name' do
.
Step 12: After installing the react-native-permissions add the below lines in package.json
and run the command npx react-native setup-ios-permissions
Step 13: Import ChatApp component from the mirrorfly-uikit-react-native.
The apiUrl
and licenseKey
details can get it from the 'Overview' section in the mirrorfly Console dashboard.
#
Initialize MirrorFly React Native UIKitTo initialize the mirrorfly, place the below code in your App.js
file inside useEffect
.
Argument | Type | Description |
---|---|---|
LICENSE_KEY | String | set your licence key |
API_URL | String | set your base url |
callBack | function | Call back function |
Note : Great!!! We are now end of the Quick Start section. For Advanced options. Click Here