With MirrorFly UIKit for iOS, you can easily build an in-app chat with all the essential messaging features.
The MirrorFly UIKit for iOS is now available for you to build and customize views at a component level through modularization.
UIKit allows you to execute key chat functions using a view controller, which is composed of a module and a view model. While the module creates and displays the UI, the view model processes and updates relevant data from Chat SDK in each view. The view controller acts as the fundamental starting point of UIKit by allowing you to create and manage your UI.
The minimum requirements for Chat SDK for iOS
- iOS 12.1 or later
Note : Before proceeding with CONTUS MirrorFly Chat SDK integration, there must be an SDK license key that needs to be obtained for your MirrorFly application.
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
You can start building a messaging experience in your app by installing MirrorFly UIKit.
Step 1: Create a Project
To get started, open Xcode, create a new Swift Project
Step 2: Install UIKit
You can import xcframework of UIKIT and all the other core SDKs of MirrorFly (downloadable in the top of this page) into your project.
Step 3: Now, disable the bitcodes for your project
Step 4: If you have not initiated any pods project before, then initiate the one. Now, add the required pods that are necessary for the SDK to execute the process perfectly.
Step 5: Now, enable all the below mentioned capabilities into your project.
Note : You should set your own container id through FlyUIKitConstants.CONTAINER_ID = "Your own App Group ID"
Step 6: Adding
Photo library usage description to your info.plist
Step 7: Initialize with License Key
You can copy the license key from the 'Overview’ section in the Console dashboard.
To integrate and run Mirrorfly UIKit in your app, you need to initialize it first. Initialize the MirrorFlyUI instance through your view controller.
FlyUIKitConstants.IS_CALL_ENABLEDshould be set to true if the user wants to avail the call feature along with the chat feature, else
FlyUIKitConstants.IS_CALL_ENABLEDshould be set to false to avail the chat feature alone.
The initialisation should be done with the parameters as below
|userID||Unique UserID of the User|
|licenseKey||LicenseKey provided by MirrorFly|
|base_Url||BASE_URL provided by the MirrorFly or the User's own base url.|
|isTrialLicense||true if you are using your own base url.|
|CALLBACK||Completion Handler used to observe the action status with arguments as result - |
Step 8: Displaying RecentChat List
MFUIRecentChatListViewController is the starting point for launching UIKit in your app. Using the below code, you can fetch the complete list of the Recent Chats.
Note : UIViewcontroller must embedded with UINavigationController.
Step 9: Send Your First Message
You can now run the app on a simulator or a plugged-in device. To send a message, you must first create a chat either single or group chat by tapping the icon in the top-right corner.
After the slection of the chat type, the app lands into the Contacts page with the all the registered users using the same license key. Then, you can select users you wish to start your chat with. Once the chat room has been created, enter your first message and send.
You've successfully sent your first message with MirrorFly.
Note : Great!!! We are now end of the Quick Start section. For Basic with various module navigation.Click here