Let's integrate SDK for Flutter
Make an easy and efficient way with CONTUS MirrorFly Chat SDK for Flutter - simply integrate the real-time chat features and functionalities into a client's app.
With client-side implementation, our chat SDK lets you initialize and configure the chat easily. With the server-side, Our solution ensures the most reliable infra-management services for the chat within the app. Furthermore, we will let you know how to install the chat SDK in your app for a better in-app chat experience.
CONTUS MirrorFly Call SDKs use the fastest way in action, to experience the same you must use our trial app to enhance your existing call app. So just download our sample app and make a start with your app development. Click here to download the sample app.
#SDK License Key
Follow the below steps to get your license key:
Step 1: Sign up into MirrorFly Console page (https://console.mirrorfly.com/register) for free MirrorFly account, If you already have a MirrorFly account, sign into your account
Step 2: Once you’re in! You get access to your MirrorFly account ‘Overview page’ where you can find a license key for further integration process
Step 3: Copy the license key from the ‘Application info’ section
#Create native dependency
MirrorFly Chat for Flutter enables realtime chat for
group chat among the users within your MirrorFly integrated app. MirrorFly SDK can initialize, configure, chat functionality in both Android and iOS project inside the Flutter application.
We have few quick easy instruction that guide you how to integrate the MirrorFly SDK.
#Create flutter dependency
STEP 1: FlySDK package need to be included in your flutter project in order to consume MirrorFly api’s.
STEP 2: Create a packages folder in your root directory.
STEP 4: Download flysdk zip file and extract and copy the flysdk folder in the packages folder
STEP 5: Add the below dependencies in “pubspec.yaml”.
STEP 5: You can use all classes and methods just with the following import statement
The below method to register a user in sandbox Live mode based on
Unless you log out the session, make a note that should never call the registration method more than once in an application
Note: While registration, the below
registerUsermethod will accept the
FCM_TOKENas an optional param and pass it across.
The connection will be established automatically upon completion of registration and not required for seperate login.
|USER_IDENTIFIER||A unique Id to Register the User|
|FCM_TOKEN||A registration token that is generated by FCM SDK for the user's app instance to send message for free|
Some of the most common terminologies used in Chat SDK with description
|userID/userBareID||Unique ID assigned for each user Ex: 12345678 (any alphanumeric). The below characters is not allowed in userId: U+0022 (") U+0026 (&) U+0027 (') U+002F (/) U+003A (:) U+003C (<) U+003E (>) U+0040 (@) userID should follow below specification: https://xmpp.org/extensions/xep-0106.html|
|userJid (or) JID||userID+@+domain of the chat server Ex. firstname.lastname@example.org|
|groupID/groupBareID||Unique ID assigned for each group Ex: group123456 (any alphanumeric). GroupJID = groupID +@mix.+domain of the chat server Ex: email@example.com`|
SDK will have built-in functions to prepare the JID, Group JID, and more.
#Send a One-to-One Message
Use the below method to send a text message to other user,
Note: To generate a unique user id by
username, you must call the below method
|TO_JID||String||JID of the end user|
|TEXT||String||Indicates the text message that needs to be sent|
|REPLY_MESSAGE_ID||String||Specifies the Message ID of replied message|
#Receive a One-to-One Message
Here the listeners would be called only when a new message is received from other user. To get more details please visit this callback listeners