Package com.cometchat.pro.core
Class CometChat
- java.lang.Object
-
- com.cometchat.pro.core.CometChat
-
public final class CometChat extends java.lang.Object
The class that the CometChat Pro Android SDK exposes to the developers to perform most of the operations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CometChat.CallbackListener<T>
static class
CometChat.CallListener
static interface
CometChat.ConnectionListener
static class
CometChat.ExtensionCallbackListener
static class
CometChat.GroupListener
GroupListener
class provides different methods to receive group events/actions
static class
CometChat.LoginListener
static class
CometChat.MessageListener
MessageListener class to provides methods to receive different types of messagesstatic interface
CometChat.OngoingCallListener
static class
CometChat.UserListener
Make use ofUserListener
class to receive user presence
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
acceptCall(java.lang.String sessionId, CometChat.CallbackListener<Call> listener)
A method to accept call between between two Users or a particular Groupstatic void
addCallListener(java.lang.String listenerId, CometChat.CallListener callListener)
To receive call events Developer needs to make use of this methodstatic void
addConnectionListener(java.lang.String listenerId, CometChat.ConnectionListener connectionListener)
To receive connection events Developer needs to make use of this methodstatic void
addExtension(com.cometchat.pro.core.CometChatExtension cometChatExtension)
static void
addGroupListener(java.lang.String listenerId, CometChat.GroupListener groupListener)
To receiver Group Actions developer can make use of this methodstatic void
addLoginListener(java.lang.String listenerId, CometChat.LoginListener loginListener)
static void
addMembersToGroup(java.lang.String GUID, java.util.List<GroupMember> members, java.util.List<java.lang.String> bannedUserIds, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.String>> listener)
To add members to a Group developer can call this methodstatic void
addMessageListener(java.lang.String listenerID, CometChat.MessageListener listener)
To receive different types of messages Developer needs to make use of this methodstatic void
addUserListener(java.lang.String listenerID, CometChat.UserListener listener)
To receive presence information of users Developer needs to make use of this methodstatic void
banGroupMember(java.lang.String uid, java.lang.String guid, CometChat.CallbackListener<java.lang.String> listener)
Method to ban a member from a Groupstatic void
blockUsers(java.util.List<java.lang.String> uids, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.String>> listener)
Method to block usersstatic void
callExtension(java.lang.String slug, java.lang.String requestType, java.lang.String endPoint, JSONObject body, CometChat.CallbackListener<JSONObject> listener)
To trigger push notification related operations directly via the SDKs.static void
connect()
Establishes a connection to the web-socket server for the logged in userstatic void
createGroup(Group group, CometChat.CallbackListener<Group> listener)
createGroup()
method is used for creating groups of different types such as public,password and private group
static void
createUser(User user, java.lang.String apiKey, CometChat.CallbackListener<User> listener)
To create users on the fly.static void
deleteConversation(java.lang.String conversationWith, java.lang.String conversationType, CometChat.CallbackListener<java.lang.String> listener)
To delete a specific conversation for the logged in user.static void
deleteGroup(java.lang.String guid, CometChat.CallbackListener<java.lang.String> listener)
deleteGroup()> is called for deleting a particular group.The method requires guid and an object of
CallbackListener
class
static void
deleteMessage(int messageId, CometChat.CallbackListener<BaseMessage> listener)
A method to delete a messagestatic void
disconnect()
Destroys the connection to the web-socket server for the logged in userstatic void
editMessage(BaseMessage message, CometChat.CallbackListener<BaseMessage> listener)
A method to edit/update a messagestatic void
endCall(java.lang.String sessionId, CometChat.CallbackListener<Call> listener)
A method to end call between between two Users or a particular Groupstatic void
endTyping(TypingIndicator typingIndicator)
Sends the end typing indicator to user or groupstatic Call
getActiveCall()
Returns Call object of Active callstatic void
getCallParticipantCount(java.lang.String sessionId, java.lang.String type, CometChat.CallbackListener<java.lang.Integer> listener)
This method helps to get the count of the participants in any particular call..static java.lang.String
getConnectionStatus()
static void
getConversation(java.lang.String conversationWith, java.lang.String conversationType, CometChat.CallbackListener<Conversation> listener)
To get individual conversation for a particular user or group.static void
getExtensionDetails(java.lang.String extensionId, CometChat.CallbackListener<com.cometchat.pro.models.CCExtension> listener)
To get details of a particular extensionstatic void
getGroup(java.lang.String guid, CometChat.CallbackListener<Group> listener)
Get information about a groupstatic void
getJoinedGroups(CometChat.CallbackListener<java.util.List<java.lang.String>> listener)
To get the list of all the joined groups for the Logged-in user.static int
getLastDeliveredMessageId()
Return last Delivered Message Idstatic User
getLoggedInUser()
Get information about logged in Userstatic void
getMessageDetails(int messageId, CometChat.CallbackListener<BaseMessage> listener)
This method get information of a single message based on the ID providedstatic void
getMessageReceipts(int messageId, CometChat.CallbackListener<java.util.List<MessageReceipt>> listener)
This method get information about the delivery and read receipts of a particular messagestatic void
getOnlineGroupMemberCount(java.util.List<java.lang.String> guids, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
To get the count of online users in specific groups.static void
getOnlineUserCount(CometChat.CallbackListener<java.lang.Integer> listener)
To get the total online users count for the app idstatic void
getUnreadMessageCount(boolean hideMessagesFromBlockedUsers, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>>> listener)
Gets unread count of messages for all users and all groupsstatic void
getUnreadMessageCount(CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>>> listener)
Gets total unread count of messages for all users and all groupsstatic void
getUnreadMessageCountForAllGroups(boolean hideMessagesFromBlockedUsers, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
Gets total unread count of messages for all Groupsstatic void
getUnreadMessageCountForAllGroups(CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
Gets total unread count of messages for all Groupsstatic void
getUnreadMessageCountForAllUsers(boolean hideMessagesFromBlockedUsers, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
Gets total unread count of messages for all Usersstatic void
getUnreadMessageCountForAllUsers(CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
Gets total unread count of messages for all Usersstatic void
getUnreadMessageCountForGroup(java.lang.String GUID, boolean hideMessagesFromBlockedUsers, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
Gets unread count of messages for a particular Groupstatic void
getUnreadMessageCountForGroup(java.lang.String GUID, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
Gets unread count of messages for a particular Groupstatic void
getUnreadMessageCountForUser(java.lang.String UID, boolean hideMessagesFromBlockedUsers, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
Gets unread count of messages for a particular Userstatic void
getUnreadMessageCountForUser(java.lang.String UID, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
Gets unread count of messages for a particular Userstatic void
getUser(java.lang.String UID, CometChat.CallbackListener<User> listener)
Get the information for a userstatic void
init(Context appContext, java.lang.String appID, AppSettings globalAppSettings, CometChat.CallbackListener<java.lang.String> listener)
This method is used to initialize the SDK with the various parameters required for the SDK to function as expected.static void
initiateCall(Call call, CometChat.CallbackListener<Call> listener)
A method to initiate call between between two Users or a particular Groupstatic boolean
isExtensionEnabled(java.lang.String extensionId)
static void
isExtensionEnabled(java.lang.String extensionId, CometChat.CallbackListener<java.lang.Boolean> listener)
To determine if a specific extension is enabled.static void
isFeatureEnabled(java.lang.String featureName, CometChat.CallbackListener<java.lang.Boolean> listener)
To detemine if a specific feature is enabled.static boolean
isInitialized()
This method is used to check if the SDK has been initialized.static void
joinGroup(java.lang.String guid, java.lang.String groupType, java.lang.String password, CometChat.CallbackListener<Group> listener)
joinGroup()
method is used to join groups of different types such as public and password group
static void
kickGroupMember(java.lang.String uid, java.lang.String guid, CometChat.CallbackListener<java.lang.String> listener)
Method to kick a member from a Groupstatic void
leaveGroup(java.lang.String guid, CometChat.CallbackListener<java.lang.String> listener)
This method is used for leaving a particular group.The method requires guid and an object ofCallbackListener
class
static void
login(java.lang.String authToken, CometChat.CallbackListener<User> listener)
This method is used to login in CometChat SDK.static void
login(java.lang.String uid, java.lang.String apiKey, CometChat.CallbackListener<User> listener)
This method is used to login in CometChat SDK.static void
logout(CometChat.CallbackListener<java.lang.String> listener)
Method to logout from CometChat SDKstatic void
markAsDelivered(int messageId, java.lang.String receiverId, java.lang.String receiverType)
Deprecated.static void
markAsDelivered(int messageId, java.lang.String receiverId, java.lang.String receiverType, java.lang.String messageSender)
This method marks the message with the provided Id and all the messages prior to that message as delivered for that particular conversationstatic void
markAsDelivered(int messageId, java.lang.String receiverId, java.lang.String receiverType, java.lang.String messageSender, CometChat.CallbackListener<java.lang.Void> listener)
This method marks the message with the provided Id and all the messages prior to that message as delivered for that particular conversationstatic void
markAsDelivered(BaseMessage message)
This method marks the message provided and all the messages prior to that message as delivered for that particular conversationstatic void
markAsDelivered(BaseMessage message, CometChat.CallbackListener<java.lang.Void> listener)
This method marks the message provided and all the messages prior to that message as delivered for that particular conversationstatic void
markAsRead(int messageId, java.lang.String receiverId, java.lang.String receiverType)
Deprecated.static void
markAsRead(int messageId, java.lang.String receiverId, java.lang.String receiverType, java.lang.String messageSender)
This method marks the message with the provided Id and all the messages prior to that message as read for that for that particular conversationstatic void
markAsRead(int messageId, java.lang.String receiverId, java.lang.String receiverType, java.lang.String messageSender, CometChat.CallbackListener<java.lang.Void> listener)
This method marks the message with the provided Id and all the messages prior to that message as read for that for that particular conversationstatic void
markAsRead(BaseMessage message)
This method marks the message provided and all the messages prior to that message as read for that particular conversationstatic void
markAsRead(BaseMessage message, CometChat.CallbackListener<java.lang.Void> listener)
This method marks the message provided and all the messages prior to that message as read for that particular conversationstatic void
registerTokenForPushNotification(java.lang.String fcmToken, CometChat.CallbackListener<java.lang.String> listener)
To register for the push notifications for the logged in userstatic void
registerTokenForPushNotification(java.lang.String fcmToken, JSONObject params, CometChat.CallbackListener<java.lang.String> listener)
To register for the push notifications for the logged in user along with custom params.static void
rejectCall(java.lang.String sessionId, java.lang.String status, CometChat.CallbackListener<Call> listener)
A method to reject call between between two Users or a particular Groupstatic void
removeCallListener(java.lang.String listenerId)
To stop receiving Call event developer can make use of this methodstatic void
removeConnectionListener(java.lang.String listenerId)
To stop receiving Connection events developer can make use of this methodstatic void
removeGroupListener(java.lang.String listenerId)
To stop receiving Group event developer can make use of this methodstatic void
removeLoginListener(java.lang.String listenerId)
static void
removeMessageListener(java.lang.String listenerID)
To stop receiving messages developer can make use of this methodstatic void
removeUserListener(java.lang.String listenerID)
To stop receiving presence information of different users developer can make use of this methodstatic void
sendCustomMessage(CustomMessage customMessage, CometChat.CallbackListener<CustomMessage> listener)
This method is used for sending custom message to a particular user or group with mentioned parameters.static void
sendMediaMessage(MediaMessage message, CometChat.CallbackListener<MediaMessage> listener)
This method is used for sending media message to a particular user or group with mentioned parametersstatic void
sendMessage(TextMessage message, CometChat.CallbackListener<TextMessage> listener)
This method is used for sending text message to a particular user or group with mentioned parametersstatic void
sendTransientMessage(com.cometchat.pro.models.TransientMessage transientMessage)
To send a transient message to a user or a group.static void
setSource(java.lang.String resource, java.lang.String platform, java.lang.String language)
static void
startCall(Activity activity, java.lang.String sessionId, RelativeLayout relativeLayout, CometChat.OngoingCallListener listener)
A method to start call between between two Users or a particular Groupstatic void
startCall(CallSettings settings, CometChat.OngoingCallListener listener)
A method to start call between between two Users or a particular Groupstatic void
startTyping(TypingIndicator typingIndicator)
Sends the typing start indicator to user or groupstatic void
tagConversation(java.lang.String conversationWith, java.lang.String conversationType, java.util.List<java.lang.String> tags, CometChat.CallbackListener<Conversation> listener)
static void
transferGroupOwnership(java.lang.String GUID, java.lang.String UID, CometChat.CallbackListener<java.lang.String> listener)
Method to transfer the group ownership to a different group memberstatic void
unbanGroupMember(java.lang.String uid, java.lang.String guid, CometChat.CallbackListener<java.lang.String> listener)
Method to unban a member from a Groupstatic void
unblockUsers(java.util.List<java.lang.String> uids, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.String>> listener)
Method to unblock usersstatic void
updateCurrentUserDetails(User user, CometChat.CallbackListener<User> listener)
To update the details of the logged in user.static void
updateGroup(Group group, CometChat.CallbackListener<Group> listener)
This method is used for updating the group information such as name,description,icon,password,type etc.static void
updateGroupMemberScope(java.lang.String uid, java.lang.String guid, java.lang.String scope, CometChat.CallbackListener<java.lang.String> listener)
Method to update scope a member in a Groupstatic void
updateUser(User user, java.lang.String apiKey, CometChat.CallbackListener<User> listener)
To update users on the fly.
-
-
-
Method Detail
-
getConnectionStatus
public static java.lang.String getConnectionStatus()
-
init
public static void init(Context appContext, java.lang.String appID, AppSettings globalAppSettings, CometChat.CallbackListener<java.lang.String> listener)
This method is used to initialize the SDK with the various parameters required for the SDK to function as expected. No other methods can be called unless theinit()
method is called.
- Parameters:
appContext
- - An object of the @see android.content.Context Context class that provides the SDK with the context of the application in which the SDK is being integrated.appID
- - App ID of the CometChat App created. This can be found at the CometChat Dashboard {@link "https://app.cometchat.io"}globalAppSettings
- - An object of the @see com.cometchat.pro.core.AppSettings AppSettings class, that holds basic settings related to the SDK.listener
- - An object of theCallbackListener<String>
class that helps inform the developer if the operation was successful or any error occurred.
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
isInitialized
public static boolean isInitialized()
This method is used to check if the SDK has been initialized.
-
login
public static void login(java.lang.String uid, java.lang.String apiKey, CometChat.CallbackListener<User> listener)
This method is used to login in CometChat SDK. Developer can only call other CometChat methods after authentication with this method.- Parameters:
uid
- Unique identifier of the userapiKey
- API_KEY of the CometChat App created. This can be found at the CometChat Dashboard {@link "https://app.cometchat.io"}.listener
- An object of theCallbackListener<User>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
,login(java.lang.String, com.cometchat.pro.core.CometChat.CallbackListener)
-
login
public static void login(java.lang.String authToken, CometChat.CallbackListener<User> listener)
This method is used to login in CometChat SDK. Developer can only call other CometChat methods after authentication with this method.- Parameters:
authToken
- AuthToken can be generated using API_KEY of the CometChat App created. Developer can also use authOnly API_KEY. This can be found at the CometChat Dashboard {@link "https://app.cometchat.io"}.listener
- An object of theCallbackListener<User>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
,User
-
connect
public static void connect()
Establishes a connection to the web-socket server for the logged in user- Since:
- v3
-
disconnect
public static void disconnect()
Destroys the connection to the web-socket server for the logged in user- Since:
- v3
-
getUser
public static void getUser(java.lang.String UID, CometChat.CallbackListener<User> listener)
Get the information for a user- Parameters:
UID
- Unique identifier of the userlistener
- An object of theCallbackListener<User>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
,User
-
sendMessage
public static void sendMessage(TextMessage message, CometChat.CallbackListener<TextMessage> listener)
This method is used for sending text message to a particular user or group with mentioned parameters- Parameters:
message
- An object of theTextMessage
class with the required details about the receiverUid, text be to sent and receiverType .
TextMessage(@NonNull String receiverUid, @NonNull String text, @CometChatConstants.ReceiverTypes String receiverType)
listener
- An object of theCallbackListener<TextMessage>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
TextMessage
,CometChatConstants.ReceiverTypes
,CometChatConstants
,CometChat.CallbackListener
-
sendMediaMessage
public static void sendMediaMessage(MediaMessage message, CometChat.CallbackListener<MediaMessage> listener)
This method is used for sending media message to a particular user or group with mentioned parameters- Parameters:
message
- An object of theMediaMessage
class with the required details about the receiverUid, file to be sent,messageType and receiverType .
MediaMessage(String receiverUid, File file, @CometChatConstants.MessageTypes String messageType, @CometChatConstants.ReceiverTypes String receiverType)
listener
- An object of theCallbackListener<MediaMessage>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
MediaMessage
,CometChatConstants.MessageTypes
,CometChatConstants.ReceiverTypes
,CometChatConstants
,CometChat.CallbackListener
-
sendCustomMessage
public static void sendCustomMessage(CustomMessage customMessage, CometChat.CallbackListener<CustomMessage> listener)
This method is used for sending custom message to a particular user or group with mentioned parameters. This method is made for developers to make their own custom messages as per requirement- Parameters:
customMessage
- An object of theCustomMessage
class with the required details about the receiverUid, receiverType,customType of the message and JSONObject of the custom data .
CustomMessage(String receiverUid, @CometChatConstants.ReceiverTypes String receiverType, String customType, @NonNull JSONObject customData )
listener
- An object of theCallbackListener<CustomMessage>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CustomMessage
,CometChatConstants
,CometChatConstants.ReceiverTypes
,CometChat.CallbackListener
-
createGroup
public static void createGroup(Group group, CometChat.CallbackListener<Group> listener)
createGroup()
method is used for creating groups of different types such as public,password and private group
- Parameters:
group
- An object of theGroup
class with the required details about the guid, name,groupType,password,icon and description based on the constructor
Group(String guid, String name, @CometChatConstants.GroupTypes String groupType, String password)
Group(String guid, String name, @CometChatConstants.GroupTypes String groupType, String password, String icon, String description)
listener
- An object of theCallbackListener<Group>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
Group
,CometChatConstants.GroupTypes
,CometChatConstants
,CometChat.CallbackListener
-
joinGroup
public static void joinGroup(java.lang.String guid, java.lang.String groupType, java.lang.String password, CometChat.CallbackListener<Group> listener)
joinGroup()
method is used to join groups of different types such as public and password group
- Parameters:
guid
- Unique identifier of a GroupgroupType
- Type of the Group user wants to joinpassword
- password of the group if the group type isCometChatConstants.GROUP_TYPE_PASSWORD
else the field can be left null or empty
listener
- An object of theCallbackListener<Group>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChatConstants.GroupTypes
,CometChatConstants
,Group
,CometChat.CallbackListener
-
leaveGroup
public static void leaveGroup(java.lang.String guid, CometChat.CallbackListener<java.lang.String> listener)
This method is used for leaving a particular group.The method requires guid and an object ofCallbackListener
class
- Parameters:
guid
- Unique identifier of a Grouplistener
- An object of theCallbackListener<String>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
updateGroup
public static void updateGroup(Group group, CometChat.CallbackListener<Group> listener)
This method is used for updating the group information such as name,description,icon,password,type etc.- Parameters:
group
- An object of theGroup
class with the required details about the guid, name,groupType,password,icon and description based on the constructor
Group(String guid, String name, @CometChatConstants.GroupTypes String groupType, String password)
Group(String guid, String name, @CometChatConstants.GroupTypes String groupType, String password, String icon, String description)
listener
- An object of theCallbackListener<Group>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
Group
,CometChatConstants.GroupTypes
,CometChatConstants
,CometChat.CallbackListener
-
deleteGroup
public static void deleteGroup(java.lang.String guid, CometChat.CallbackListener<java.lang.String> listener)
deleteGroup()> is called for deleting a particular group.The method requires guid and an object of
CallbackListener
class
- Parameters:
guid
- Unique identifier of a Grouplistener
- An object of theCallbackListener<String>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
getGroup
public static void getGroup(java.lang.String guid, CometChat.CallbackListener<Group> listener)
Get information about a group- Parameters:
guid
- Unique identifier of the Grouplistener
- An object of theCallbackListener<Group>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
,User
,Group
-
kickGroupMember
public static void kickGroupMember(java.lang.String uid, java.lang.String guid, CometChat.CallbackListener<java.lang.String> listener)
Method to kick a member from a Group- Parameters:
uid
- Unique identifier of a Userguid
- Unique identifier of a Grouplistener
- An object of theCallbackListener<String>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
banGroupMember
public static void banGroupMember(java.lang.String uid, java.lang.String guid, CometChat.CallbackListener<java.lang.String> listener)
Method to ban a member from a Group- Parameters:
uid
- Unique identifier of a Userguid
- Unique identifier of a Grouplistener
- An object of theCallbackListener<String>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
unbanGroupMember
public static void unbanGroupMember(java.lang.String uid, java.lang.String guid, CometChat.CallbackListener<java.lang.String> listener)
Method to unban a member from a Group- Parameters:
uid
- Unique identifier of a Userguid
- Unique identifier of a Grouplistener
- An object of theCallbackListener<String>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
updateGroupMemberScope
public static void updateGroupMemberScope(java.lang.String uid, java.lang.String guid, java.lang.String scope, CometChat.CallbackListener<java.lang.String> listener)
Method to update scope a member in a Group- Parameters:
uid
- Unique identifier of a Userguid
- Unique identifier of a Groupscope
- Scope to be assigned to the userlistener
- An object of theCallbackListener<String>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
,CometChatConstants.MemberScope
-
transferGroupOwnership
public static void transferGroupOwnership(java.lang.String GUID, java.lang.String UID, CometChat.CallbackListener<java.lang.String> listener)
Method to transfer the group ownership to a different group member- Parameters:
GUID
- Unique identifier of the groupUID
- Unique identifier of the userlistener
- An object of theCallbackListener<String>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
,CometChatConstants.MemberScope
-
startTyping
public static void startTyping(TypingIndicator typingIndicator)
Sends the typing start indicator to user or group- Parameters:
typingIndicator
- An object ofTypingIndicator
class which requires receiverId and receiverType.
TypingIndicator(@NonNull String receiverId, @CometChatConstants.ReceiverTypes String receiverType)
TypingIndicator(@NonNull String receiverId, @CometChatConstants.ReceiverTypes String receiverType, @NonNull JSONObject metadata)
- See Also:
CometChatConstants.ReceiverTypes
,TypingIndicator
-
endTyping
public static void endTyping(TypingIndicator typingIndicator)
Sends the end typing indicator to user or group- Parameters:
typingIndicator
- An object ofTypingIndicator
class which requires receiverId and receiverType.
TypingIndicator(@NonNull String receiverId, @CometChatConstants.ReceiverTypes String receiverType)
TypingIndicator(@NonNull String receiverId, @CometChatConstants.ReceiverTypes String receiverType, @NonNull JSONObject metadata)
- Since:
- v1
- See Also:
CometChatConstants.ReceiverTypes
,TypingIndicator
-
markAsRead
@Deprecated public static void markAsRead(int messageId, java.lang.String receiverId, java.lang.String receiverType)
Deprecated.This method marks the message with the provided Id and all the messages prior to that message as read for that for that particular conversation- Parameters:
messageId
- Unique Id of the message to be markedreceiverId
- Id of the receiver whose message to be markedreceiverType
- Type of the receiver whether user or group- Since:
- v1
- See Also:
CometChatConstants.ReceiverTypes
-
markAsRead
public static void markAsRead(int messageId, java.lang.String receiverId, java.lang.String receiverType, java.lang.String messageSender, CometChat.CallbackListener<java.lang.Void> listener)
This method marks the message with the provided Id and all the messages prior to that message as read for that for that particular conversation- Parameters:
messageId
- Unique Id of the message to be markedreceiverId
- Id of the receiver whose message to be markedreceiverType
- Type of the receiver whether user or groupmessageSender
- The UID of the sender of the message.listener
- An object of theCallbackListener<Void>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v3
- See Also:
CometChatConstants.ReceiverTypes
-
markAsRead
public static void markAsRead(int messageId, java.lang.String receiverId, java.lang.String receiverType, java.lang.String messageSender)
This method marks the message with the provided Id and all the messages prior to that message as read for that for that particular conversation- Parameters:
messageId
- Unique Id of the message to be markedreceiverId
- Id of the receiver whose message to be markedreceiverType
- Type of the receiver whether user or groupmessageSender
- The UID of the sender of the message.- Since:
- v3
- See Also:
CometChatConstants.ReceiverTypes
-
markAsRead
public static void markAsRead(BaseMessage message, CometChat.CallbackListener<java.lang.Void> listener)
This method marks the message provided and all the messages prior to that message as read for that particular conversation- Parameters:
message
- An object of theBaseMessage
class which requires receiverUid,type and receiverType
BaseMessage(String receiverUid, String type, @CometChatConstants.ReceiverTypes String receiverType)
listener
- An object of theCallbackListener<Void>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v3
- See Also:
CometChatConstants.ReceiverTypes
-
markAsRead
public static void markAsRead(BaseMessage message)
This method marks the message provided and all the messages prior to that message as read for that particular conversation- Parameters:
message
- An object of theBaseMessage
class which requires receiverUid,type and receiverType
BaseMessage(String receiverUid, String type, @CometChatConstants.ReceiverTypes String receiverType)
- Since:
- v3
- See Also:
CometChatConstants.ReceiverTypes
-
markAsDelivered
@Deprecated public static void markAsDelivered(int messageId, java.lang.String receiverId, java.lang.String receiverType)
Deprecated.Marks message as Delivered- Parameters:
messageId
- Unique Id of the message to be markedreceiverId
- Id of the receiver whose message to be markedreceiverType
- Type of the receiver whether user or group- Since:
- v1
- See Also:
CometChatConstants.ReceiverTypes
-
markAsDelivered
public static void markAsDelivered(int messageId, java.lang.String receiverId, java.lang.String receiverType, java.lang.String messageSender, CometChat.CallbackListener<java.lang.Void> listener)
This method marks the message with the provided Id and all the messages prior to that message as delivered for that particular conversation- Parameters:
messageId
- Unique Id of the message to be markedreceiverId
- Id of the receiver whose message to be markedreceiverType
- Type of the receiver whether user or groupmessageSender
- The UID of the sender of the message.listener
- An object of theCallbackListener<Void>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v3
- See Also:
CometChatConstants.ReceiverTypes
-
markAsDelivered
public static void markAsDelivered(int messageId, java.lang.String receiverId, java.lang.String receiverType, java.lang.String messageSender)
This method marks the message with the provided Id and all the messages prior to that message as delivered for that particular conversation- Parameters:
messageId
- Unique Id of the message to be markedreceiverId
- Id of the receiver whose message to be markedreceiverType
- Type of the receiver whether user or groupmessageSender
- The UID of the sender of the message.- Since:
- v3
- See Also:
CometChatConstants.ReceiverTypes
-
markAsDelivered
public static void markAsDelivered(BaseMessage message, CometChat.CallbackListener<java.lang.Void> listener)
This method marks the message provided and all the messages prior to that message as delivered for that particular conversation- Parameters:
message
- An object of theBaseMessage
class which requires receiverUid,type and receiverType
BaseMessage(String receiverUid, String type, @CometChatConstants.ReceiverTypes String receiverType)
listener
- An object of theCallbackListener<Void>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v3
- See Also:
CometChatConstants.ReceiverTypes
-
markAsDelivered
public static void markAsDelivered(BaseMessage message)
This method marks the message provided and all the messages prior to that message as delivered for that particular conversation- Parameters:
message
- An object of theBaseMessage
class which requires receiverUid,type and receiverType
BaseMessage(String receiverUid, String type, @CometChatConstants.ReceiverTypes String receiverType)
- Since:
- v3
- See Also:
CometChatConstants.ReceiverTypes
-
logout
public static void logout(CometChat.CallbackListener<java.lang.String> listener)
Method to logout from CometChat SDK- Parameters:
listener
- An object of theCallbackListener<String>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
initiateCall
public static void initiateCall(Call call, CometChat.CallbackListener<Call> listener)
A method to initiate call between between two Users or a particular Group- Parameters:
call
- An object of theCall
class which requires receiverId,receiverType and callType to work as expected
listener
- An object of theCallbackListener<Call>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
Call
,CometChatConstants.ReceiverTypes
,CometChatConstants.CallType
,CometChat.CallbackListener
-
rejectCall
public static void rejectCall(java.lang.String sessionId, java.lang.String status, CometChat.CallbackListener<Call> listener)
A method to reject call between between two Users or a particular Group- Parameters:
sessionId
- The Unique sessionId of the call be to rejectedstatus
- Status to be sent while rejecting a callCometChatConstants.CALL_STATUS_REJECTED
CometChatConstants.CALL_STATUS_CANCELLED
CometChatConstants.CALL_STATUS_BUSY
listener
- An object of theCallbackListener<Call>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChatConstants.CallType
,Call
,CometChat.CallbackListener
-
acceptCall
public static void acceptCall(java.lang.String sessionId, CometChat.CallbackListener<Call> listener)
A method to accept call between between two Users or a particular Group- Parameters:
sessionId
- The Unique sessionId of the call be to rejectedlistener
- An object of theCallbackListener<Call>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
Call
,CometChat.CallbackListener
-
endCall
public static void endCall(java.lang.String sessionId, CometChat.CallbackListener<Call> listener)
A method to end call between between two Users or a particular Group- Parameters:
sessionId
- The Unique sessionId of the call be to endedlistener
- An object of theCallbackListener<Call>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
Call
,CometChat.CallbackListener
-
startCall
public static void startCall(Activity activity, java.lang.String sessionId, RelativeLayout relativeLayout, CometChat.OngoingCallListener listener)
A method to start call between between two Users or a particular Group- Parameters:
activity
- Activity reference where you want to show the call viewsessionId
- The Unique sessionId of the call be to rejectedrelativeLayout
- An object of the relativeLayout class in which CometChat can load the calling viewslistener
- An object of theOngoingCallListener
class that helps inform the developer about the ongoing call events like
onYouJoined()
,
onYouLeft()
,
onUserJoined()
,
onUserDisconnected()
,
onCallEnded()
and
onError()
- Since:
- v1
- See Also:
CallManager.CallListener
-
startCall
public static void startCall(CallSettings settings, CometChat.OngoingCallListener listener)
A method to start call between between two Users or a particular Group- Parameters:
settings
- An object of theCallSettings
class, that provides the settings for the call to be startedlistener
- An object of theOngoingCallListener
class that helps inform the developer about the ongoing call events like
onYouJoined()
,
onYouLeft()
,
onUserJoined()
,
onUserDisconnected()
,
onCallEnded()
and
onError()
- Since:
- v1
- See Also:
CallManager.CallListener
-
getActiveCall
public static Call getActiveCall()
Returns Call object of Active call- Returns:
- Call Object of the currently Active Call
- Since:
- v2
- See Also:
Call
-
getLastDeliveredMessageId
public static int getLastDeliveredMessageId()
Return last Delivered Message Id- Returns:
- id of message
- Since:
- v1
-
addExtension
public static void addExtension(com.cometchat.pro.core.CometChatExtension cometChatExtension)
-
isExtensionEnabled
public static boolean isExtensionEnabled(java.lang.String extensionId)
-
blockUsers
public static void blockUsers(java.util.List<java.lang.String> uids, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.String>> listener)
Method to block users- Parameters:
uids
- List of UID to be blockedlistener
- An object of theCallbackListener<HashMap<String,String>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
unblockUsers
public static void unblockUsers(java.util.List<java.lang.String> uids, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.String>> listener)
Method to unblock users- Parameters:
uids
- List of UID to be blockedlistener
- An object of theCallbackListener<HashMap<String,String>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
getMessageReceipts
public static void getMessageReceipts(int messageId, CometChat.CallbackListener<java.util.List<MessageReceipt>> listener)
This method get information about the delivery and read receipts of a particular message- Parameters:
messageId
- Unique id of the messagelistener
- An object of theCallbackListener<List<MessageReceipt>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
,MessageReceipt
-
getMessageDetails
public static void getMessageDetails(int messageId, CometChat.CallbackListener<BaseMessage> listener)
This method get information of a single message based on the ID provided- Parameters:
messageId
- Unique id of the messagelistener
- An object of theCallbackListener<List<MessageReceipt>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v3
- See Also:
CometChat.CallbackListener
-
getUnreadMessageCountForUser
public static void getUnreadMessageCountForUser(java.lang.String UID, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
Gets unread count of messages for a particular User- Parameters:
UID
- Unique identifier of a Userlistener
- An object of theCallbackListener<HashMap<String,Integer>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
getUnreadMessageCountForUser
public static void getUnreadMessageCountForUser(java.lang.String UID, boolean hideMessagesFromBlockedUsers, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
Gets unread count of messages for a particular User- Parameters:
UID
- Unique identifier of a UserhideMessagesFromBlockedUsers
- boolean parameter to show or hide messages count of the blocked userlistener
- An object of theCallbackListener<HashMap<String,Integer>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
getUnreadMessageCountForGroup
public static void getUnreadMessageCountForGroup(java.lang.String GUID, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
Gets unread count of messages for a particular Group- Parameters:
GUID
- Unique identifier of a Grouplistener
- An object of theCallbackListener<HashMap<String,Integer>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
getUnreadMessageCountForGroup
public static void getUnreadMessageCountForGroup(java.lang.String GUID, boolean hideMessagesFromBlockedUsers, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
Gets unread count of messages for a particular Group- Parameters:
GUID
- Unique identifier of a GrouphideMessagesFromBlockedUsers
- boolean parameter to show or hide messages count of the blocked userlistener
- An object of theCallbackListener<HashMap<String,Integer>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
getUnreadMessageCount
public static void getUnreadMessageCount(CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>>> listener)
Gets total unread count of messages for all users and all groups- Parameters:
listener
- An object of theCallbackListener<HashMap<String,HashMap<String,Integer>>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
getUnreadMessageCount
public static void getUnreadMessageCount(boolean hideMessagesFromBlockedUsers, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>>> listener)
Gets unread count of messages for all users and all groups- Parameters:
hideMessagesFromBlockedUsers
- boolean parameter to show or hide messages count of the blocked userlistener
- An object of theCallbackListener<HashMap<String,HashMap<String,Integer>>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
getUnreadMessageCountForAllUsers
public static void getUnreadMessageCountForAllUsers(CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
Gets total unread count of messages for all Users- Parameters:
listener
- An object of theCallbackListener<HashMap<String,Integer>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
getUnreadMessageCountForAllUsers
public static void getUnreadMessageCountForAllUsers(boolean hideMessagesFromBlockedUsers, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
Gets total unread count of messages for all Users- Parameters:
hideMessagesFromBlockedUsers
- boolean parameter to show or hide messages count of the blocked userlistener
- An object of theCallbackListener<HashMap<String,Integer>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
getUnreadMessageCountForAllGroups
public static void getUnreadMessageCountForAllGroups(CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
Gets total unread count of messages for all Groups- Parameters:
listener
- An object of theCallbackListener<HashMap<String,Integer>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
getUnreadMessageCountForAllGroups
public static void getUnreadMessageCountForAllGroups(boolean hideMessagesFromBlockedUsers, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
Gets total unread count of messages for all Groups- Parameters:
hideMessagesFromBlockedUsers
- boolean parameter to show or hide messages count of the blocked userlistener
- An object of theCallbackListener<HashMap<String,Integer>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
editMessage
public static void editMessage(BaseMessage message, CometChat.CallbackListener<BaseMessage> listener)
A method to edit/update a message- Parameters:
message
- An object of theBaseMessage
class which requires receiverUid,type and receiverType
BaseMessage(String receiverUid, String type, @CometChatConstants.ReceiverTypes String receiverType)
listener
- An object of theCallbackListener<BaseMessage>
class that helps inform the developer if the operation was successful or any error occurred
- See Also:
CometChatConstants.ReceiverTypes
,CometChat.CallbackListener
-
deleteMessage
public static void deleteMessage(int messageId, CometChat.CallbackListener<BaseMessage> listener)
A method to delete a message- Parameters:
messageId
- Id of the message to be deletedlistener
- An object of theCallbackListener<BaseMessage>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChatConstants.ReceiverTypes
,CometChat.CallbackListener
-
addMembersToGroup
public static void addMembersToGroup(java.lang.String GUID, java.util.List<GroupMember> members, java.util.List<java.lang.String> bannedUserIds, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.String>> listener)
To add members to a Group developer can call this method- Parameters:
GUID
- Unique Identifier of the Groupmembers
- List of Group members to added into the groupbannedUserIds
- List of members to be banned into the grouplistener
- An object of theCallbackListener<HashMap<String,String>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- v1
- See Also:
CometChat.CallbackListener
-
registerTokenForPushNotification
public static void registerTokenForPushNotification(java.lang.String fcmToken, CometChat.CallbackListener<java.lang.String> listener)
To register for the push notifications for the logged in user- Parameters:
fcmToken
- fcm Token required for receiving push notificationslistener
- An object of theCallbackListener<HashMap<String,String>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- 2.0.2
- See Also:
CometChat.CallbackListener
-
registerTokenForPushNotification
public static void registerTokenForPushNotification(java.lang.String fcmToken, JSONObject params, CometChat.CallbackListener<java.lang.String> listener)
To register for the push notifications for the logged in user along with custom params.- Parameters:
fcmToken
- fcm Token required for receiving push notificationsparams
- A JSONObject which can be used to pass extra parameters.listener
- An object of theCallbackListener<HashMap<String,String>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- 2.0.2
- See Also:
CometChat.CallbackListener
-
createUser
public static void createUser(User user, java.lang.String apiKey, CometChat.CallbackListener<User> listener)
To create users on the fly.- Parameters:
user
- object of theUser
class containing the data for the User.apiKey
- Auth API Key.listener
- An object of theCallbackListener<
User
>class that helps inform the developer if the operation was successful or any error occurred
- Since:
- 2.0.3
- See Also:
CometChat.CallbackListener
-
updateUser
public static void updateUser(User user, java.lang.String apiKey, CometChat.CallbackListener<User> listener)
To update users on the fly.- Parameters:
user
- object of theUser
class containing the data for the User.apiKey
- Auth API Key.listener
- An object of theCallbackListener<
User
>class that helps inform the developer if the operation was successful or any error occurred
- Since:
- 2.0.3
- See Also:
CometChat.CallbackListener
-
getJoinedGroups
public static void getJoinedGroups(CometChat.CallbackListener<java.util.List<java.lang.String>> listener)
To get the list of all the joined groups for the Logged-in user.- Parameters:
listener
- An object of theCallbackListener<<String>>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- 2.0.3
- See Also:
CometChat.CallbackListener
-
getConversation
public static void getConversation(java.lang.String conversationWith, java.lang.String conversationType, CometChat.CallbackListener<Conversation> listener)
To get individual conversation for a particular user or group.- Parameters:
conversationWith
- The uid/guid of the user/group for which the conversation is to be fetched.conversationType
- The type of the conversation(user/group)listener
- An object of theCallbackListener<
Conversation
>class that helps inform the developer if the operation was successful or any error occurred
- Since:
- 2.0.4
- See Also:
CometChat.CallbackListener
-
tagConversation
public static void tagConversation(java.lang.String conversationWith, java.lang.String conversationType, java.util.List<java.lang.String> tags, CometChat.CallbackListener<Conversation> listener)
-
setSource
public static void setSource(java.lang.String resource, java.lang.String platform, java.lang.String language)
-
callExtension
public static void callExtension(java.lang.String slug, java.lang.String requestType, java.lang.String endPoint, JSONObject body, CometChat.CallbackListener<JSONObject> listener)
To trigger push notification related operations directly via the SDKs.- Parameters:
slug
- Slug of the extensionrequestType
- Type of the requestendpoint
- Endpoint of the URL For the respective extensionlistener
- An object of theCallbackListener<JSONObject>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- 2
- See Also:
CometChat.CallbackListener
-
isFeatureEnabled
public static void isFeatureEnabled(java.lang.String featureName, CometChat.CallbackListener<java.lang.Boolean> listener)
To detemine if a specific feature is enabled.- Parameters:
featureName
- Name of the feature to be checkedlistener
- An object of theCallbackListener<Boolean>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- 2.0
- See Also:
CometChat.CallbackListener
-
isExtensionEnabled
public static void isExtensionEnabled(java.lang.String extensionId, CometChat.CallbackListener<java.lang.Boolean> listener)
To determine if a specific extension is enabled.- Parameters:
featureName
- Name of the extension to be checkedlistener
- An object of theCallbackListener<Boolean>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- 2.0
- See Also:
CometChat.CallbackListener
-
getExtensionDetails
public static void getExtensionDetails(java.lang.String extensionId, CometChat.CallbackListener<com.cometchat.pro.models.CCExtension> listener)
To get details of a particular extension- Parameters:
featureName
- Id of the extension for which the details are to be fetchedlistener
- An object of theCallbackListener<@Link{CCExtension}>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- 2.0
- See Also:
CometChat.CallbackListener
-
getCallParticipantCount
public static void getCallParticipantCount(java.lang.String sessionId, java.lang.String type, CometChat.CallbackListener<java.lang.Integer> listener)
This method helps to get the count of the participants in any particular call..- Parameters:
sessionId
- The session Id of the call for which the participant count is to be fetchedtype
- The type of the call(direct/default)listener
- An object of theCallbackListener<Integer>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- 2.0.4
- See Also:
CometChat.CallbackListener
-
updateCurrentUserDetails
public static void updateCurrentUserDetails(User user, CometChat.CallbackListener<User> listener)
To update the details of the logged in user.- Parameters:
user
- An object of the @link{User} class containing the details to be updatedlistener
- An object of theCallbackListener<@link{User}>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- 2.0
- See Also:
CometChat.CallbackListener
-
deleteConversation
public static void deleteConversation(java.lang.String conversationWith, java.lang.String conversationType, CometChat.CallbackListener<java.lang.String> listener)
To delete a specific conversation for the logged in user.- Parameters:
conversationWith
- The UID/GUID of the conversation to be deleted.conversationType
- The type of the conversations (user/group)listener
- An object of theCallbackListener<String>
class that helps inform the developer if the operation was successful or any error occurred
- Since:
- 2.0
- See Also:
CometChat.CallbackListener
-
sendTransientMessage
public static void sendTransientMessage(com.cometchat.pro.models.TransientMessage transientMessage)
To send a transient message to a user or a group.- Parameters:
transientMessage
- An object of the @link{TransientMessage}.- Since:
- 2.0
- See Also:
CometChat.CallbackListener
-
getOnlineUserCount
public static void getOnlineUserCount(CometChat.CallbackListener<java.lang.Integer> listener)
To get the total online users count for the app id- Since:
- 2.0
- See Also:
CometChat.CallbackListener
-
getOnlineGroupMemberCount
public static void getOnlineGroupMemberCount(java.util.List<java.lang.String> guids, CometChat.CallbackListener<java.util.HashMap<java.lang.String,java.lang.Integer>> listener)
To get the count of online users in specific groups.- Since:
- 2.0
- See Also:
CometChat.CallbackListener
-
addMessageListener
public static void addMessageListener(java.lang.String listenerID, CometChat.MessageListener listener)
To receive different types of messages Developer needs to make use of this method- Parameters:
listenerID
- Unique Identifier for the Listenerlistener
- An object of theMessageListener
class
- Since:
- v1
- See Also:
CometChat.MessageListener
-
removeMessageListener
public static void removeMessageListener(java.lang.String listenerID)
To stop receiving messages developer can make use of this method- Parameters:
listenerID
- Unique Identifier for the Listener which was used inaddMessageListener()
- Since:
- v1
-
addUserListener
public static void addUserListener(java.lang.String listenerID, CometChat.UserListener listener)
To receive presence information of users Developer needs to make use of this method- Parameters:
listenerID
- Unique Identifier for the Listenerlistener
- An object of theUserListener
class
- Since:
- v1
- See Also:
CometChat.UserListener
-
removeUserListener
public static void removeUserListener(java.lang.String listenerID)
To stop receiving presence information of different users developer can make use of this method- Parameters:
listenerID
- Unique Identifier for the Listener which was used inaddUserListener()
- Since:
- v1
-
addCallListener
public static void addCallListener(java.lang.String listenerId, CometChat.CallListener callListener)
To receive call events Developer needs to make use of this method- Parameters:
listenerId
- Unique Identifier for the ListenercallListener
- An object of theCallListener
class
- Since:
- v1
- See Also:
CometChat.CallListener
-
removeCallListener
public static void removeCallListener(java.lang.String listenerId)
To stop receiving Call event developer can make use of this method- Parameters:
listenerId
- Unique Identifier for the Listener which was used inaddCallListener()
- Since:
- v1
-
addConnectionListener
public static void addConnectionListener(java.lang.String listenerId, CometChat.ConnectionListener connectionListener)
To receive connection events Developer needs to make use of this method- Parameters:
listenerId
- Unique Identifier for the ListenerconnectionListener
- An object of theConnectionListener
class
- Since:
- v2
- See Also:
CometChat.CallListener
-
removeConnectionListener
public static void removeConnectionListener(java.lang.String listenerId)
To stop receiving Connection events developer can make use of this method- Parameters:
listenerId
- Unique Identifier for the Listener which was used inaddConnectionListener()
- Since:
- v1
-
addGroupListener
public static void addGroupListener(java.lang.String listenerId, CometChat.GroupListener groupListener)
To receiver Group Actions developer can make use of this method- Parameters:
listenerId
- Unique Identifier for the ListenergroupListener
- An object of theGroupListener
class
- Since:
- v1
- See Also:
CometChat.GroupListener
-
removeGroupListener
public static void removeGroupListener(java.lang.String listenerId)
To stop receiving Group event developer can make use of this method- Parameters:
listenerId
- Unique Identifier for the Listener which was used inaddGroupListener()
- Since:
- v1
-
getLoggedInUser
public static User getLoggedInUser()
Get information about logged in User- Returns:
- User object which contains information about the logged in user
- Since:
- v1
- See Also:
User
-
addLoginListener
public static void addLoginListener(java.lang.String listenerId, CometChat.LoginListener loginListener)
-
removeLoginListener
public static void removeLoginListener(java.lang.String listenerId)
-
-