ChatSDK must be authenticated with the backend server using the License key obtained from the console. Write the license key to ChatSDK by calling the below method in the
didFinishLaunchingWithOptions method of AppDelegate.
But only after setting the app group id using the method
FlyUtils.setAppGroupContainerId(id: CONTAINER_ID ).
An SDK must be in compliance to multiple privacy and security laws across the major nations to distribute the application in those countries. As of now our ChatSDK is in compliance to GDPR, for that personal sensitive information has to encrypted. We need to provide an IV for those encryption and decryption process.
Profile IV must be a string of length 16, orelse encryption/decryption will fail.
To start using the sdk, there were few data that were required by the SDK for initialization. For which we use the
ChatSDK builder class. In your
AppDelegate class , under 'didFinishLaunchingWithOptions' use the below method to pass those required data to the SDK . An example can be found below.
|enableContactSync||if set |
|setDomainBaseUrl||url needed for api calls provided by Chat team|
|setMaximumPinningForRecentChat||maximum pin count in recent chat|
|setGroupConfiguration||configuration for the group implementation|
|deleteMediaFromDevice||To show whether contact's profile name or nickname from sdk|
|setAppGroupContainerID||Pass group container id of the project to store UserDefaults and Database|
|buildAndInitialize||n/a||initialize the chat configuration|
|enableGroupCreation||enable/disable group creation|
|setMaximumMembersInAGroup||set the maximum number of members a group can have(cannot be greater than 300)|
|build||n/a||build GroupConfig object|
Base url must have http/https protocol and should end with
/ else an exception will be thrown.
To receive messages in the background or in the killed state, kindly register for remote notification by conforming to the following delegates in the AppDelegate
Call the below methods when an APNS token gets updated.
In order to access data between app and notification extension, enabling app group is mandatory, and a group container id is necessary for Chat sdk to function properly.
|APP_GROUP_ID||Id of the application App group|
Sets the group container id in AppDelegate's
and in the
didReceive methods of the class that extends
UNNotificationServiceExtension before calling any other Call SDK methods even before the Call SDK Builder method.
Chat SDK also requires the application to enable the below capabilities to function seamlessly without any issues.
|Audio,Airplay, and Picture in Picture|
To register a new user use the below method. This method will take care sandbox mode registration or live mode registration based on
FlyDefaults.isTrialLicense value provided. Kindly set
FlyDefaults.isTrialLicenseto false to point to dedicated server or else to
test on trial server.
|UNIQUE_IDENTIFIER||String||unique id of the user|
|APNS_TOKEN||String||APNS token generated by the app|
|VOIP_TOKEN||String||VOIP token generated by the app|
|IS_LIVE||Bool||while exporting set it to |
In order to send messages using the chat sdk , at first you need to establish the connection to the server. sdk provides methods for initializing the connection configuration as well as methods for making connection.
At first initialize the connection details using the below method. This method will store the connection details in persistent storage to make connection automatically once you close and reopen the app.
|USERNAME||String||userName for making connection to the server|
|SECRET_KEY||String||password used to authenticate to the xmpp server|
|XMPP_DOMAIN||String||domain name which will be used in jid|
|XMPP_HOST||String||xmpp server url|
|XMPP_PORT||int||port of the xmpp server|
Once you initialized the connection details, for the first time you need to call the below method to make connection to the chat server immediately after that you don't need to call this method anymore, sdk will handle connection and disconnection on behalf of you.
Once register is successful call the below method and pass the IV and auth token to SDK.
|IV||String||Initialization vector for data encryption and decryption|
|TOKEN||String||Auth token received during registration for making api calls|