Let's integrate SDK for Flutter
warning
MirrorFly Chat SDK V1 for Flutter is no longer supported as a new version is released. Check out our latest Chat SDK V2 here.
Make an easy and efficient way with CONTUS TECH 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.
note
Just download our sample app and make a start with your app development. Click here to download the sample app.
#
SDK License KeyFollow 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 dependencyMirrorFly Chat for Flutter enables realtime chat for one-on-one
or 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 dependencySTEP 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 3:
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
#
RegistrationThe below method to register a user in sandbox Live mode.
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
registerUser
method will accept theFCM_TOKEN
as an optional param and pass it across.The connection will be established automatically upon completion of registration and not required for seperate login
.
Argument | Type | Description |
---|---|---|
userIdentifier | String | A unique Id to Register the User. We accept only the AlphaNumeric String |
token | String | A registration token that is generated by FCM SDK for the user's app instance to send message for free |
#
TerminologySome of the most common terminologies used in Chat SDK with description
keyword | Explanation |
---|---|
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. 12345678@xmpp.chatsystem.dev.contus.us |
groupID/groupBareID | Unique ID assigned for each group Ex: group123456 (any alphanumeric). GroupJID = groupID +@mix.+domain of the chat server Ex: group123456@mix.xmpp.mirrorfly.dev.contus.us` |
SDK will have built-in functions to prepare the JID, Group JID, and more.
#
Send a One-to-One MessageUse the below method to send a text message to other user,
Note: To generate a unique user jid by
username
, you must call the below method
Argument | Type | Description |
---|---|---|
jid | String | JID of the end user |
message | String | Indicates the text message that needs to be sent |
replyMessageId | String | Specifies the Message ID of replied message |
#
Receive a One-to-One MessageHere the listeners would be called only when a new message is received from other user. To get more details please visit this callback listeners