README.md
file.
Download Swift Chat App
Download Obj-c Chat App
Download iOS SDK from Github
Podfile
by running the following command.
CometChatSDK
framework through CocoaPods.
CometChatSDK
by command.
https://github.com/cometchat/sdk/ios.git
and set dependency rule to Up to Next Major Version
and set version as 6
. Then click on the Add Package button.CometChatSDK
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”:
Header Search Paths
to $SDKROOT/usr/include/libxml2
.
init()
method initializes the settings required for CometChat.
The init()
method takes the below parameters:
setRegion()
method.AppSettings
class allows you to configure three settings:
didFinishLaunchingWithOptions:
method of the AppDelegate
class.
appId
with your CometChat App ID in the above code.
createUser()
method. This method takes a User
object and the API Key
as input parameters and returns the created User
object if the request is successful.
login()
method.
The login method needs to be called in the following scenarios:
CometChat.getLoggedInUser()
function returns nil.API_KEY
with your CometChat ApiKey in the above code.
cometchat-uid-1
, cometchat-uid-2
, cometchat-uid-3
, cometchat-uid-4
and cometchat-uid-5
.login()
method returns the User object containing all the information of the logged in user.