App ID
, AuthKey
, and Region
of your CometChat application when initializing the SDK.
i. Register on CometChat
Each CometChat application can be integrated with a single client app. Within the same application, users can communicate with each other across all platforms, whether they are on mobile devices or on the web.iii. IDE Setup
CometChatUIKitSwift
into your Package Repository
as below:init( )
method. This ensures all necessary settings are configured for CometChatUIKit.
It’s crucial to call this method on app startup before using any other functions from CometChat UI Kit or CometChat SDK.
Initialize CometChatUIkit within your app delegate’s didFinishLaunchingWithOptions method
.
UIKitSettings
Class. It is intended for use primarily during proof-of-concept (POC) development or in the early stages of application development. You can use the Auth Token method to log in securely.Make sure to replace the appId with your CometChat appId and region with your app region in the above code.
UID
. You can create your own users on the CometChat Dashboard or via API. We have pre-generated test users: cometchat-uid-1
, cometchat-uid-2
, cometchat-uid-3
, cometchat-uid-4
, cometchat-uid-5
.
The Login method returns the User object containing all the information of the logged-in user.
Make sure you replace the authKey with your CometChat Auth Key in the above code.
CometChatConversations.
View Controller: To use ConversationsWithMessages in your view controller
, use the following code snippet.
Navigation controller,
use the following code snippet in your willConnectTo
method in SceneDelegate.