Get your Application Keys
Signup for CometChat and then:- Create a new app
- Head over to the API Keys section and note the Auth Key, App ID & Region
Minimum Requirement
- Xcode 12 (or Higher)
- iOS 11 or higher
Add the CometChat Dependency
CocoaPods
We recommend using CocoaPods, as they are the most advanced way of managing iOS project dependencies. Open a terminal window, move to your project directory, and then create aPodfile
by running the following command.
- CometChatPro SDK supports installation through Cocoapods only. Currently, we are supporting Xcode 11.4 and higher.
- CometChatPro SDK includes video calling components. We suggest you run on physical devices to avoid errors.
2.4.1+ onwards, Voice & Video Calling functionality has been moved to a separate framework. In case you do not plan to use the calling feature, please add the Calling framework
pod 'CometChatCalls', '2.1.1'
in your app Podfile.CometChatPro
framework through CocoaPods.
CometChatPro
by command
Request Authorization
Prepare your app for this requirement by providing justification strings. The justification string is a localizable message that you add to your app’sInfo.plist
file to tell the user why your app needs access to the user’s photo library, Camera, Microphone. Then, App prompts the user to grant permission for access, the alert displays the justification string you provided, in the language of the locale selected on the user’s device. You can do this as follows:

Setup Bitcode
You can set the Enable Bitcode setting to YES present in build settings in your XCode project.
If you are using CometChat Pro SDK having the version less than 2.0.8, then you need to set Enable Bitcode to NO
Swift Standard Libraries
CometChatPro
framework build on Swift, you have to ensure the required libraries are embedded. This can be done by setting the “Always Embed Swift Standard Libraries”
checkbox in your target’s build settings to “Yes”:

Set Header Search Path
Set theHeader Search Paths
to $SDKROOT/usr/include/libxml2
.

For Xcode 12 and above, we need to add arm64 in the excluded architecture of build settings as Apple supports only arm architecture for simulators and actual devices. No support provided for X86_64 and i386 architectures.
Setting for build for active architecture
In Build Settings, enable active architecture to Yes

Initialize CometChat
Theinit()
method initializes the settings required for CometChat. We suggest you call the method on app startup preferably in the didFinishLaunchingWithOptions:
method of the AppDelegate
class.
appId
with your CometChat App ID in the above code.