CometChat
provides you with live events related to users. Below are the callback methods provided by the CometChatUserDelegate
.
Delegate Method | Information |
---|---|
onUserOnline: | This method is triggered when a user comes online and is available to chat. The details of the user can be obtained from the user object received as the method parameter. |
onUserOffline: | This method is triggered when a user goes offline. The details of the user can be obtained from the User object received as the parameter. |
CometChatUserDelegate
as Shown Below:
viewDidLoad()
as CometChat.userdelegate = self
CometChatGroupDelegate
provides you with all the real-time events related to groups. Below are the callback methods provided by the CometChatGroupDelegate
.
Method | Information |
---|---|
onGroupMemberJoined(Action action, User joinedUser, Group joinedGroup) | This method is triggered when a user joins any group. All the members present in the group will receive this event. |
onGroupMemberLeft(Action action, User leftUser, Group leftGroup) | This method is triggered when a user who was a member of any group leaves the group. All the members of the group receive this event. |
onGroupMemberKicked(Action action, User kickedUser, User kickedBy, Group kickedFrom) | This method is triggered when a user is kicked from a group. All the members including the user receive this event |
onGroupMemberBanned(Action action, User bannedUser, User bannedBy, Group bannedFrom) | This method is triggered when a user is banned from a group. All the members including the user receive this event |
onGroupMemberUnbanned(Action action, User unbannedUser, User unbannedBy, Group unbannedFrom) | This method is triggered when a user is banned from a group. All the members of the group receive this event. |
onGroupMemberScopeChanged(Action action, User updatedBy, User updatedUser, String scopeChangedTo, String scopeChangedFrom, Group group) | This method is triggered when the scope of any Group Member has been changed. All the members that are a part of that group receive this event |
onMemberAddedToGroup(Action action, User addedby, User userAdded, Group addedTo) | This method is triggered when a user is added to any group. All the members including the user himself receive this event. |
CometChatGroupDelegate
as shown below:
viewDidLoad()
as CometChat.groupdelegate = self
CometChatMessageDelegate
provides you with live events related to messages. Below are the callback methods provided by the CometChatMessageDelegate
.
Method | Information |
---|---|
onTextMessageReceived(TextMessage message) | This event is triggered when a Text Message is received. |
onMediaMessageReceived(MediaMessage message) | This event is triggered when a Media Message is received. |
onCustomMessageReceived(CustomMessage message) | This event is triggered when a Custom Message is received. |
onTypingStarted(TypingIndicator typingIndicator) | This event is triggered when a user starts typing in a user/group conversation |
onTypingEnded(TypingIndicator typingIndicator) | This event is triggered when a user stops typing in a user/group conversation. |
onMessagesDelivered(MessageReceipt messageReceipt) | This event is triggered when a set of messages are marked as delivered for any particular conversation. |
onMessagesRead(MessageReceipt messageReceipt) | This event is triggered when a set of messages are marked as read for any particular conversation. |
onMessageEdited(BaseMessage message) | This method is triggered when a particular message has been edited in a user/group conversation. |
onMessageDeleted(BaseMessage message) | This event is triggered when a particular message is deleted in a user/group conversation. |
CometChatMessageDelegate
as Shown Below :
viewDidLoad()
as CometChat.messagedelegate = self
CometChatCallDelegate
provides you with live events related to calls. Below are the callback methods provided by the CometChatCallDelegate
.
Method | Information |
---|---|
onIncomingCallReceived(Call call) | This event is triggered when the logged-in user receives an incoming call. The details of the call can be obtained from the Call object received as the method parameter. |
onOutgoingCallAccepted(Call call) | This event is triggered when the call initiated by the logged-in user is accepted by the recipient. The details of the call can be obtained from the Call object received as the method parameter. |
onOutgoingCallRejected(Call call) | This event is triggered when the call initiated by the logged-in user is rejected by the recipient. The details of the call can be obtained from the Call object received as the method parameter |
onIncomingCallCancelled(Call call) | This event is triggered when an incoming call is canceled by the initiator of the call. The details of the call can be obtained from the Call object received as the method parameter |
call
events, you must add protocol conformance CometChatCallDelegate
as Shown Below :
viewDidLoad()
as CometChat.calldelegate = self