Let's integrate our UIKIT in few minutes
#
Download#
SDK UIKit for AndroidMirrorfly 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. Our development kit includes light and dark themes, text fonts, colors and more. You can customize these components to create an interactive messaging unique interface.
#
RequirementsThe requirements for chat SDK for Android are:
- Android Marshmallow 6.0 (API Level 23) or above
- Java 8 or higher
- Gradle 4.1.0 or higher
#
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.
Follow the below steps to get your license key:
Step 1: Let’s Create an Account - Sign up into MirrorFly Console page (https://console.mirrorfly.com/register) for free MirrorFly account
Step 2: Create an account with your basic details including your name, organization details, work email, and contact number
Step 3: Once you’re in! You get access to your MirrorFly account ‘Overview page’ where you can find a license key as well as downloadable Android SDK for further integration process
Step 4: To download the AAR files from the Android SDKs, click on ‘Download’ which will take you to the top of the guided documentation page, here, click on the ‘Download button’ and extract the AAR files from the ZIP folder
Step 5: Once finished with the download, now it's time to start with the integration process that begins with creating a new project to develop a chat app.
#
IntegrationAs soon as the AAR files have been imported from the zip file using Kotlin, you can start over with the integration process.
Step 1: Create a new project or Open an existing project in Android Studio
Step 2: Add the following libraries in app/libs folder in the project
- appbase.aar
- flycommons.aar
- flynetwork.aar
- flydatabase.aar
- videocompression.aar
- xmpp.aar
- mfuikitsdk.aar
- flycall.aar
- flywebrtc.aar
- cameraview.aar
- zoomimageview.aar
- mediapicker.aar
- imagecropper.aar
- googletranslation.aar
Step 3: Add the below code in the app/build.gradle file.
Note : In case "The 'kotlin-android-extensions' Gradle plugin is no longer supported" then remove the 'kotlin-android-extensions' from app/build.gradle plugins".
Step 4: Add the below code in the settings.gradle file.
Step 5: Add the following dependencies in the app/build.gradle file.
Step 6: Add the below dependencies required by the SDK in the app/build.gradle file.
Step 7: Add the below dependencies required by the SDK in the app module/build.gradle file.
Step 8: Add the below line in the gradle.properties file, to avoid imported library conflicts.
Step 9: Open the AndroidManifest.xml and add below permissions.
#
InitializationTo integrate and run Mirrorfly UIKit in your app, you need to initialize it first. You can initialize the MirrorFlyUIKit instance by passing the MirrorFlyUIKitAdapter instance as an argument to a parameter in the MirrorFlyUIKit.init() method. The MirrorFlyUIKit.init() must be called once in the onCreate() method of your app’s Application instance.
Then provide your APP_NAME
BASE_URL
LICENCE_KEY
isCallEnabled = false
and If you have subscription set isTrialLicenceKey true
else set isTrialLicenceKey false
This BASE_URL
and LICENCE_KEY
can be obtained from 'Overview' section from the Console dashboard.
Argument | Type | Description |
---|---|---|
YOUR_APP_NAME | String | set your application name |
YOUR_APPLICATION_ID | String | set your application id |
YOUR_BASE_URL | String | set your base url |
YOUR_LICENCE_KEY | String | set your licence key |
YOUR_GOOGLE_TRANSLATION_KEY | String | set your Translation key |
isTrialLicenceKey | Boolean | set true or false |
isContactEnable | Boolean | set true or false |
isCallEnabled | Boolean | set true or false |
isGroupEnable | Boolean | set true or false |
isOwnProfileEnable | Boolean | set true or false |
isOtherProfileEnable | Boolean | set true or false |
#
Add BaseApplicationAdd the created BaseApplication to AndroidManifest.xml.
Note : Use the "Theme.MaterialComponents.DayNight.NoActionBar" in the style.xml or themes.xml to avoid the app bar in the call screen.
#
RegistrationThe below method to register a user.
info
Unless you log out the session, make a note that should never call the registration method more than once in an application.
Note : Use the Mirrorfly UIKIt SDK registration function after your application login process.
Argument | Type | Description |
---|---|---|
USER_IDENTIFIER | String | Unique Id to Register the User |
FIREBASE TOKEN | String | Firebase Token for Message and Call Push Notification |
#
Display Recent Chat and Call listDashBoardActivity is the starting point for launching UIKit in your application. By implementing the code below, you will see a complete list of recent chats that you're made with single and group conversation.
Note : Use
DashBoardActivity
only when you have done the registration.
#
Sending a messageYou can now run the application on an emulator or a plugged-in device. To send a message, you must first start a conversation by clicking on the icon in the top-right corner. Then, you can select the user you wish to chat. Once navigated to user chat screen, type your first message and press send.
#
Recent & Single Chat