iOS API

Objective C classes can be used to enhance CometChat functionality. Classes available

Class Description
CometChat The class has methods associated with sending/receving text and multimedia messages to a user
CometChatChatroom The class has methods associated with sending/receving text and multimedia messages to a group
AudioChat The class has methods associated with audio call
AVChat The class has methods associated with video call
AVBroadcast The class has methods associated with video broadcast
GroupAVChat The class has methods associated with video broadcast

CometChat

To add user to user chat in your app,

Include the class <MessageSDKFramework/CometChat.h> in the .h file of your class.

Initialize CometChat object

CometChat *cometchat =  [[CometChat alloc] initWithAPIKey:@""];

Methods available:

Method Description
subscribeWithMode The method starts receiving messages, announcements and user information
sendMessage The method allows you to send text messages and emojis
sendImageWithData The method allows you to send an image
sendAudioWithPath The method allows you to send audio file
sendFileWithPath The method allows you to send a file
getUserInfo The method provides you with the user details
changeStatus The method allows you to change user’s status
changeStatusMessage The method allows you to change user’s status message
blockUser The method allows you to block a user
unblockUser The method allows you to unblock a user
getBlockedUsersList The method provides list of all the users blocked by the logged-in user
getAllAnnouncements The method provides list of all the announcements
getChatHistoryOfUser The method provides the chat history
setTranslationLanguage The method sets a language for translating the messages at real time
isCometChatInstalled The method checks if CometChat is installed on your server
getPluginInfo The method retrieves CometChat plugin information
isLoggedIn The variable is a boolean flag to indicate whether the user is logged-in or not
isTyping The variable is a boolean flag to indicate whether the user is currently typing or not
Unsubscribe The method stops receiving messages, announcements and user information

GroupChat

To add group chat in your app,

Include the class in the <MessageSDKFramework/GroupChat.h> file of your class.

Initialize the GroupChat object as follows

GroupChat *groupchat =  [[GroupChat alloc] init];

Methods available:

Method Description
subscribeToGroupWithMode The method starts receiving group messages and group information
createGroup The method allows you to create a group
joinGroup The method allows you to join a group
sendMessage The method allows you to send text messages and emojis
sendImageWithData The method allows you to send an image
sendAudioWithPath The method allows you to send audio file
sendFileWithPath The method allows you to send a file
leaveGroup The method allows you to leave a group
getAllGroups The method provides list of all groups associated with logged-in user
deleteGroup The method allows you to delete a group
getGroupMembers The method provides list of all the members of a group
isSubscribedToGroup The method checks if a logged-in user has subscribed
unsubscribeFromGroupChat The method stops receiving messages, announcements and user information

AudioChat

To add audio calling in your app,

Include the class <MessageSDKFramework/AudioChat.h> in the .h file of your class.

Initialize the AudioChat object as follows:

AudioChat *audioChat =  [[AudioChat alloc] init];

Methods available:

Method Description
sendAudioChatRequestToUser The method send audio call request
acceptAudioChatRequestOfUser The method allows you to accept the incoming audio call
startAudioChatWithCallID The method starts audio call
endAudioChatWithUser The method allows you to end the audio call
cancelAudioChatRequestWithUser The method allows you to cancel outgoing audio call
sendBusyCallToUser The method allows you to send busy notification to incoming audio call
rejectAudioChatRequestOfUser The method allows you to reject incoming audio call
toggleAudio The method allows you mute/unmute audio

AVChat

To add video calling in your app,

Include the class <MessageSDKFramework/AVChat.h> in the .h file of your class.

Initialize the AVChat object as follows:

AVChat *avChat =  [[AVChat alloc] init];

Methods available:

Method Description
sendAVChatRequestToUser The method send video call request
acceptAVChatRequestOfUser The method allows you to accept the incoming video call
startAVChatWithCallID The method starts video call
endAVChatWithUser The method allows you to end the video call
cancelAVChatCallWithUser The method allows you to cancel outgoing video call
sendBusyCallToUser The method allows you to send busy notification to incoming video call
rejectAVChatCallWithUser The method allows you to reject incoming video call
toggleAudio The method allows you to mute/unmute audio
toggleVideo The method allows you to mute/unmute video
switchCamera The method allows you to switch between front and rear camera

AVBroadcast

To add video broadcast in your app,

Include the class <MessageSDKFramework/AVBroadcast.h> in the .h file of your class.

Initialize the AVChat object as follows:

AVBroadcast *avbroadcast =  [[AVBroadcast alloc] init];

Methods available:

Method Description
sendAVBroadcastRequestToUser The method send video broadcast request
acceptAVBroadcastRequestOfUser The method allows you to accept the incoming video broadcast
startAVBroadcastWithInitiator The method starts video broadcast
endAVBroadcastWithUser The method allows you to end the video call
switchCamera The method allows you to switch between front and rear camera

GroupAVChat

To add video call for groups in your app,

Include the class <MessageSDKFramework/GroupAVChat.h> in the .h file of your class.

Initialize the AVChat object as follows:

GroupAVChat *groupAVChat = [[GroupAVChat alloc] init];

Methods available:

Method Description
sendConferenceRequest The method send video call request to a group
joinConference The method allows you to join the ongoing conference
startConferenceInContainer The method allows you to start a conference in a given UI container
endConference The method allows end/leave the conference
toggleAudio The method allows you to mute/unmute audio
toggleVideo The method allows you to mute/unmute video
switchCamera The method allows you to switch between front and rear camera

  • Was this helpful?
  • Yes   No