Quickstart
Channelize.io iOS UI Kit helps you build real-time messaging with pre-built screens. It provides you various methods to initialize and configure UI SDK and set the data into various pre-built screens.
NOTE: Channelize.io iOS UI Kit is using Channelize.io iOS API SDK for networking and real-time events.
Install iOS UI Kit
Step 1: Integration
Note: Please make sure you use same integration method for all SDKs.
1. Manual Integration
Install SDK
- Download the Channelize UI SDK zip file from here.
- Extract the downloaded file to a folder. It will provide
ChannelizeUI.xcframework
file. - Add it to your project in same way you have added
ChannelizeAPI
SDK.
Install Pods
Add following pods to the existing Podfile
that you had created while installing API SDK.
pod 'InputBarAccessoryView', '4.2.2'
pod 'SDWebImageFLPlugin'
pod 'MaterialComponents'
pod 'DifferenceKit'
pod 'ReachabilitySwift'
pod 'VirgilE3Kit'
Now run below command to install the pods after navigating to project directory through terminal
pod install --verbose
2. Through Cocoapods
Install UI Kit Pod
Add UI Kit pod to the existing Podfile
that you had created while installing API SDK.
pod 'ChannelizeUI', '>= 4.20.13'
Now run below command to install the pods after navigating to project directory through terminal
pod install --repo-update --verbose
Step 2: Update Channelize-Info.plist File
You need to update Channelize-Info.plist
file w.r.t to the type of features you want. For e.g. put GIPHY_API_KEY
if you want to use GIFs and Stickers messages, MAP_API_KEY
if you want to use location based messages. These keys are optional.
<key>MAP_API_KEY</key>
<string>xxxx Map Key xxxx</string>
<key>GIPHY_API_KEY</key>
<string>xxxx GIPHY API Key xxxx</string>
Create a .string file with the name CHLocalizable.strings
in your project directory. Copy all entries from this file and you can change them to resonate with your use-case.
CHLocalizable.strings
Step 3: Grant System Permissions
To use all features of iOS UI Kit, grant system permissions by adding the following lines to the app main Info.plist
file. Skip a permission if you don't want to have that functionality inside your app.
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>This app wants to access your device's camera.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>This app wants to access your device's location when app is in background.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app wants to access your device's location when app is in foreground.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app wants to access your device's photo library.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app wants to access your device's microphone</string>
Step 4: Use SDKs Methods & Properties
Now use all classes and methods with the import statement.
import ChannelizeAPI
import ChannelizeUI
Launch iOS UI SDK
To launch the home page of the Channelize.io Messaging use the following code.
if Channelize.getCurrentUserId() != "" {
if let navigationController = UIApplication.shared.keyWindow?.rootViewController as? UINavigationController {
ChUI.launchChannelize(navigationController: navigationController)
}
}
To launch Channelize.io for a specific user, use the following code.
let userData : [AnyHashable:Any] = ["userId":24567]
if Channelize.getCurrentUserId() != "" {
if let navigationController = UIApplication.shared.keyWindow?.rootViewController as? UINavigationController {
ChUI.launchChannelize(navigationController: navigationController, data: userData)
}
}