Install and Configure
You can integrate Channelize.io SDKs by two methods
- Through Cocoapods
- Manual Integration
Channelize.io SDKs are built to run both on Simulator and Device. With the release of Xcode 11, Apple introduced a new bundle format using the .xcframework file extension. This format allows multiple copies of a framework compiled for different architectures and platforms to be combined into a single structure. Currently, Cocoapods doesn't support it in non-beta versions. It is only supported in 1.10.0.beta.1
version. If you are using this beta version then you can proceed with the Cocoapods method, else use manual integration method. To check your current cocoapod version, open terminal and run the command
pod --version
If you want to update it to latest beta version run the command
gem install cocoapods --pre
or using sudo
sudo gem install cocoapods --pre
For more guides, please visit Cocoapods Guides
Integration
1. Manual Integration
Install Pods
For developers who had never used CocoaPods for an Xcode project, open a terminal window, move to your project directory, and then create a Podfile by running the below command:
pod init
Add the below lines to the Podfile:
platform :ios, '11.0'
target 'YourProject' do
use_frameworks!
pod 'AWSMobileClient'
pod 'AWSIoT'
pod 'Alamofire', '4.8.2'
pod 'ObjectMapper'
end
Now install the pods using the command:
pod install --repo-update --verbose
Note: If you have already integrated pods in your project just add below pods to your podfile
pod 'AWSMobileClient'
pod 'AWSIoT'
pod 'Alamofire', '4.8.2'
pod 'ObjectMapper'
Add Channelize API SDK
- Download the Channelize API SDK zip file from here.
- Extract the downloaded file to a folder. It will provide
ChannelizeAPI.xcframework
file. - Open
yourproject.xcworkspace
file with Xcode. Right-click on the main project and selectAdd files to YOUR_PROJECT
.
- Select the downloaded
ChannelizeAPI.xcframework
file. Make sure to selectCopy Items if Needed
in the Selecter window.
- Select
Embed and Sign
inFrameworks, Libraries, and Embedded Content
forChannelizeAPI.xcframework
2. Through Cocoapods
Note: Make sure you have 1.10.0.beta.1
or above version of Cocoapods
Install Pods
For developers who had never used CocoaPods for an Xcode project, open a terminal window, move to your project directory, and then create a Podfile by running the below command:
pod init
Add the below lines to the Podfile:
platform :ios, '11.0'
target 'YourProject' do
use_frameworks!
pod 'ChannelizeAPI' '>= 4.20.12'
end
Now install the pods using the command:
pod install --repo-update --verbose
Note: If you have already integrated pods in your project just add below pods to your podfile
pod 'ChannelizeAPI' '>= 4.20.12'
Create Channelize-Info.plist File
You need to create a .plist file with name Channelize-Info.plist which will contain all required keys i.e Channelize.io Public Key, Giphy API Key, Agora API Key, and Maps API Key.
For using iOS API SDK this file should only have Public key as shown below:
<key>PUBLIC_KEY</key>
<string>xxxx PublicKey xxxx</string>
Use SDK Methods
Now use all classes and methods with the import statement.
import ChannelizeAPI
Configure SDK
To configure SDK you need to add the following code in didFinishLaunchingWithOptions
function of your project's AppDelegate.swift
file.
Channelize.configure()