Let's integrate our SDK in few minutes

Getting started#
Download SDK Files
Download

Introduction#

Through our Chat SDK for iOS, you can efficiently integrate real-time chat into your app. On the client-side implementation, you can initialize, configure and build the chat with minimal effort.

On the server-side, MirrorFly ensures reliable infra-management services for your chat within the app. All server setup related documents can be downloaded from control panel's download section. This and Initialization page provide the Chat SDK’s structure and installation steps, then goes through the preliminary steps of implementing the Chat SDK in your own project.

Note : The fastest way to see our Chat SDK in action is to build your chat app on top of our sample app. Make sure to change the application ID of the sample app to your own. To download sample app click here

Requirements#

The minimum requirements for Chat SDK for iOS are:

  • Xcode 13.1 and above
  • iOS 12.1 and above
  • Project and Pods bitcode has to be disabled.

SDK License Key#

Your SDK must be authenticated by MirrorFly server using License Key.

Please follow below step to get your license key:

Step 1: Create an account here in MirrorFly console, if you already have an account please goto step 3.

Step 2: Validate your account by following the steps provided in console and login to your account.

Step 3: Please login to your account here

Step 4: Copy license key under "Application info" in "Overview" page

Installation#

The SDK is already compiled into a framework file. To use the SDK, the below framework files has to be imported into the project. Chat sdk needs Swift support in your project.

Step 1: Download the latest SDK from MirrorFly Control Panel Download's section

Step 2: Extract the files from downloaded zip file

Step 3: Create a new iOS project or Open a existing project

Step 4: Add the following frameworks in app folder of the project

  • FlyCore.framework
  • FlyCommon.framework
  • FlyNetwork.framework
  • FlyDatabase.framework
  • FlyXmpp.framework

Step 5: Choose 'Embed and Sign' under General -> Frameworks,libraries and Embedded content of all the above frameworks added to the project.

Step 6: Add the below dependencies required by the SDk in Pods file

pod 'libPhoneNumber-iOS'
pod 'Alamofire' # Version 5 and above
pod 'RealmSwift', '10.20.1'
pod 'XMPPFramework/Swift'
pod 'SocketRocket'
pod 'Socket.IO-Client-Swift', '~> 15.2.0'
pod 'GoogleWebRTC' # for calls SDK

Step 7: Add the pod hook below in the pod file to set deployment target,disable bitcode and to enable library evolution.

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.1'
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'No'
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end

Terminology#

The below table contains some mostly used keywords in sdk with their explanation

keywordExplanation
userID/userBareIDUnique 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) JIDuserID+@+domain of the chat server Ex. 12345678@xmpp.chatsystem.dev.contus.us
groupID/groupBareIDUnique 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`
info

Sdk is having a built-in functions to prepare the JID, Group JID. :::