CometChat class

Flutter wrapper for using CometChat SDK.

for more information on how to use wrapper effectively.

Constructors

CometChat(String appId, {@Deprecated('The authKey is deprecated due to security concerns. Please use [otherMethod] instead.') String? authKey, String region = 'us'})
Constructor for creating CometChat object appId refers to your CometChat App ID. region The region where the app was created.

Properties

appId → String
final
authKey → String?
Use this only for testing purpose
final
hashCode → int
The hash code for this object.
no setterinherited
region → String
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

debugDeliveryGateOpen → bool
Test-only: true while realtime delivery is serialised behind a media-edit hydrate (BEH-MEDIA-18 / BEH-INV-02).
no setter
nativeStream ↔ Stream?
This is stream channel to receiver messages
getter/setter pair

Static Methods

acceptCall(String sessionID, {required dynamic onSuccess(Call call)?, required dynamic onError(CometChatException excep)}) → void
Accepts an incoming call.
addAIAssistantListener(String listenerId, AIAssistantListener listenerClass) → void
Call-SDK-changes
addCallListener(String listenerId, CallListener listenerClass) → void
Call-SDK-changes
addConnectionListener(String listenerId, ConnectionListener listenerClass) → void
The ConnectionListener class provides you with all the status of the connection to CometChat web-socket servers
addConversationListener(String listenerId, ConversationListener listener) → void
Adds a ConversationListener for conversation pin/unpin events (Pin Conversation, ENG-37600).
addGroupListener(String listenerId, GroupListener listenerClass) → void
The GroupListener class provides you with all the real-time events related to groups
addloginListener(String listenerId, LoginListener listenerClass) → void
The LoginListener class provides you with all the real-time updates for the login and logout events
addMediaDownloadListener(String id, MediaDownloadListener listener) → void
Offline media: observe background (AUTO-mode) media downloads so a UI tile can refresh when the bytes land.
addMembersToGroup({required String guid, required List<GroupMember> groupMembers, required dynamic onSuccess(Map<String?, String?> result)?, required dynamic onError(CometChatException excep)?}) → Future<Map<String?, String?>?>
Adds members to a group.
addMessageListener(String listenerId, MessageListener listenerClass) → void
For every activity or fragment you wish to receive messages in, you need to register the MessageListener
addNotificationFeedListener(String listenerId, NotificationFeedListener listener) → void
Register a NotificationFeedListener for real-time notification feed events.
addOfflineCacheResetListener(String id, OfflineCacheResetListener listener) → void
Offline: be told when the SDK wipes and rebuilds the offline cache and loses its unsent messages — a lost or wrong key, a corrupt file, a repeated open failure, or a change to the encryption setting (BEH-ENC-15). Not fired by a logout.
addOfflineMessageListener(String id, OfflineMessageListener listener) → void
Offline: observe every queued send across all conversations — pending, sent and failed. This is also how a send that flushes after an app relaunch (its per-call listener is gone) reports its delivery.
addReaction(int messageId, String reaction, {required dynamic onSuccess(BaseMessage)?, required dynamic onError(CometChatException excep)?}) → Future<BaseMessage?>
Add a reaction to a message.
addSyncListener(String id, SyncListener listener) → void
Offline: register a phase-based SyncListener (conversation + message sync phases, each with start / complete / error). No-op when disabled.
addUserListener(String listenerId, UserListener listenerClass) → void
The UserListener class provides you with live events related to users listenerId unique id for listener
askBot(String receiverId, String receiverType, String botId, String question, {Map? configuration, required dynamic onSuccess(String conversationSummary), required dynamic onError(CometChatException excep)}) → Future<void>
Ask an AI bot a question in the context of a conversation.
banGroupMember({required String guid, required String uid, required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<String?>
Bans a member from a group.
blockUser(List<String>? uids, {required dynamic onSuccess(Map<String, dynamic> map)?, required dynamic onError(CometChatException excep)?}) → Future<Map<String, dynamic>?>
Block a user from sending logged-in user any messages.
callExtension(String slug, String requestType, String endPoint, Map<String, dynamic>? body, {required dynamic onSuccess(Map<String, dynamic> map)?, required dynamic onError(CometChatException excep)?}) → Future<Map<String, dynamic>?>
can call any extension
clearActiveCall() → Future<void>
Clears the locally stored active call session.
clearOfflineCache() → Future<void>
Offline: wipes the per-user offline cache — messages, conversations, the pending outbox, and the downloaded media bytes on disk (which are the bulk of the space). No-op when disabled.
connect({dynamic onSuccess(String result)?, dynamic onError(CometChatException excep)?}) → Future<Null>
will establish the Web-socket connections manually
createGroup({required Group group, required dynamic onSuccess(Group group)?, required dynamic onError(CometChatException excep)?}) → Future<Group?>
Returns a Group object after creating in CometChat API.
createGroupWithMembers({required Group group, required List<GroupMember> groupMembers, List<String> bannedUserIds = const [], dynamic onSuccess(Group group)?, dynamic onError(CometChatException excep)?}) → Future<Group?>
Creates a group in CometChat along with initial members and returns the created Group.
createUploadFileRequest(String receiverId, String receiverType, {int? parentMessageId}) → UploadFileRequest
Creates an UploadFileRequest scoped to one destination and one batch.
createUser(User user, String authKey, {required dynamic onSuccess(User user)?, required dynamic onError(CometChatException excep)?}) → Future<User?>
Method returns user after creation in cometchat environment
debugCancelStreamSubscriptions() → void
Test-only: run the logout / reinit stream-teardown boundary (_cancelStreamSubscriptions) so D-281's gate reset + generation bump can be exercised without a full auth flow.
debugDeliverCachedConversation(String conversationWith, String conversationType, ConversationDetailsListener listener) → Future<void>
Serves the cached conversation for the two-phase getConversation.
debugOnRealtimeMessage(BaseMessage message) → void
Test-only: feed one realtime message frame through the facade's handler.
debugSetOfflineEnabledOverride(bool? value) → void
Test-only seam: force isOfflineEnabled to a fixed answer.
deleteConversation(String conversationWith, String conversationType, {required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<void>
Method deletes the conversation only for the logged-in user.
deleteGroup(String guid, {required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<void>
Deletes a group.
deleteMessage(int messageId, {required dynamic onSuccess(BaseMessage)?, required dynamic onError(CometChatException excep)?}) → Future<void>
Deletes the message with specified messageId.
discardLocalMessage(String localMessageId, {required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<void>
Offline: delete a message that has not been sent (BEH-SEND-36).
disconnect({dynamic onSuccess(String result)?, dynamic onError(CometChatException excep)?}) → Future<Null>
will disable the Web-socket connections manually
dispatchSyncedMessages(List<BaseMessage> fresh, List<BaseMessage> updated, {bool isCurrent()?}) → Future<void>
Offline (E3): fans a reconnect catch-up page out to message listeners. Genuinely-new swept messages go through the normal per-type receive path; updates to already-cached messages go through the bulk onMessagesSynced. Both are decorated source == 'SYNC'. action/call are excluded by the caller. Invoked by the offline runtime after the page is persisted.
downloadMedia(BaseMessage message, {MediaCallbackListener? listener}) → Future<void>
Offline media: explicitly download + cache message's attachment.
editMessage(BaseMessage message, {required dynamic onSuccess(BaseMessage)?, required dynamic onError(CometChatException excep)?}) → Future<BaseMessage?>
edit a message, you can use the editMessage() method
endCall(String sessionID, {int? joinedAt, required dynamic onSuccess(Call call)?, required dynamic onError(CometChatException excep)}) → void
Ends an ongoing call.
endTyping({required String receiverUid, required String receiverType}) → Future<void>
method to inform the receiver that the logged in user has ended typing.
flagMessage(int messageId, FlagDetail detail, {dynamic onSuccess(String result)?, dynamic onError(CometChatException excep)?}) → Future<String?>
Flags a message for content moderation.
forceSyncNow({ForceSyncListener? callback}) → Future<void>
Get the current WebSocket connection status.
getActiveCall() → Future<Call?>
Gets the currently active call session.
getCachedMediaPath(BaseMessage message) → Future<String?>
Offline media: the local file path for message's attachment if the bytes are cached. Never touches the network.
getCacheSize() → Future<int>
Offline: total local bytes held by the cache (database + media).
getConnectionStatus() → Future<String>
Behavior and signature remain identical for backward compatibility.
getConversation(String conversationWith, String conversationType, {required dynamic onSuccess(Conversation conversation)?, required dynamic onError(CometChatException excep)?, ConversationDetailsListener? listener}) → Future<Conversation?>
In order to fetch a specific conversation
getConversationFromMessage(BaseMessage message, {required dynamic onSuccess(Conversation conversation)?, required dynamic onError(CometChatException excep)?}) → Future<Conversation?>
get the conversation object from message object.
getConversationStarter(String receiverId, String receiverType, {Map? configuration, required dynamic onSuccess(List<String> conversationStarters), required dynamic onError(CometChatException excep)}) → Future<void>
Get AI-generated conversation starter suggestions.
getConversationSummary(String receiverId, String receiverType, {Map? configuration, required dynamic onSuccess(String conversationSummary), required dynamic onError(CometChatException excep)}) → Future<void>
Get AI-generated summary of a conversation.
getConversationUpdateSettings({dynamic onSuccess(ConversationUpdateSettings)?, dynamic onError(CometChatException excep)?}) → Future<ConversationUpdateSettings>
Retrieves the ConversationUpdateSettings object to enable or disable certain features.
getExistingUploadFileRequest(String receiverId, String receiverType, {int? parentMessageId}) → Future<UploadFileRequest?>
Returns the existing upload batch for a destination, re-attached to its persisted state, or null when none exists (offline-uploads-spec OU-13).
getFlagReasons({dynamic onSuccess(List<FlagReason> reasons)?, dynamic onError(CometChatException excep)?}) → Future<List<FlagReason>?>
Retrieves the list of flag reasons available for reporting content.
getGroup(String guid, {required dynamic onSuccess(Group group)?, required dynamic onError(CometChatException excep)?}) → Future<Group?>
Gets group details.
getLastDeliveredMessageId({dynamic onSuccess(int lastMessageId)?}) → Future<int?>
Get last delivered message ID.
getLastSyncTimestamp() → Future<int?>
Offline: epoch-ms of the last completed message-sync, or null if the cache has never synced (facade getLastSyncTimestamp).
getLoggedInUser({dynamic onSuccess(User user)?, dynamic onError(CometChatException excep)?}) → Future<User?>
Returns logged in User Object
getMaxAttachmentCount() → int
The maximum number of attachments allowed in a single message (file.count.max, default 10), from the cached app settings — falling back to the documented client default when the key is absent. Validate the attachment count against this before starting an upload.
getMaxAttachmentSize() → int
The maximum size, in bytes, allowed per attachment (file.size.max, default 100 MB), from the cached app settings — falling back to the documented client default when the key is absent. Size is validated per file only; there is no per-message aggregate cap.
getMediaCachingMode() → MediaCachingMode
Offline media: the receive-side caching mode (auto / off).
getMessageDetails(int messageId, {dynamic onSuccess(BaseMessage)?, dynamic onError(CometChatException excep)?}) → Future<BaseMessage?>
Fetches a single message by messageId.
getMessageReceipts(int messageId, {required dynamic onSuccess(List<MessageReceipt> messageReceipt)?, required dynamic onError(CometChatException excep)?}) → Future<List<MessageReceipt>?>
Method to get message receipts.
getNotificationFeedItem(String id, {required dynamic onSuccess(NotificationFeedItem feedItem)?, required dynamic onError(CometChatException excep)?}) → Future<NotificationFeedItem?>
Fetches a single NotificationFeedItem by its ID.
getNotificationFeedUnreadCount({required dynamic onSuccess(int lastMessageId)?, required dynamic onError(CometChatException excep)?}) → Future<int?>
Gets the unread count for the notification feed.
getOfflineEncryptionStatus() → OfflineEncryptionStatus
Offline: the encryption status of the local cache — what was achieved, not what was configured.
getOnlineGroupMemberCount(List<String> guids, {required dynamic onSuccess(Map<String, int> result)?, required dynamic onError(CometChatException excep)?}) → Future<Map<String, int>?>
get the total count of online users in particular groups Get online member count for multiple groups.
getOnlineUserCount({required dynamic onSuccess(int lastMessageId)?, required dynamic onError(CometChatException excep)?}) → Future<int?>
get the total count of online users for your app
getPendingMessages() → Future<List<BaseMessage>>
Offline: the PENDING / SENDING / FAILED outbox messages (empty when offline is disabled).
getPinnedConversationsLimit() → int?
Max user-pinned conversations (features.ux.conversations.pinned.limit on the /me payload). Same absence semantics as getPinnedMessagesLimit.
getPinnedMessagesLimit() → int?
Max user-pinned messages per conversation (features.ux.messages.pinned.limit on the /me payload).
getSavedMessagesLimit() → int?
Max saved messages per user (features.ux.messages.saved.limit on the /me payload). Same absence semantics as getPinnedMessagesLimit; the cap error is ERR_SAVED_MESSAGES_LIMIT_EXCEEDED.
getSmartReplies(String receiverId, String receiverType, {Map? configuration, required dynamic onSuccess(HashMap<String, String>), required dynamic onError(CometChatException excep)}) → Future<void>
Get AI-generated smart reply suggestions for a conversation.
getSyncState() → SyncState
Offline: the current sync state (idle / syncing).
getUnreadMessageCount({bool? hideMessagesFromBlockedUsers, dynamic onSuccess(Map<String, Map<String, int>> message)?, dynamic onError(CometChatException excep)?}) → Future<Map<String, Map<String, int>>?>
Gives count of unread messages for every one-on-one and group conversation.
getUnreadMessageCountForAllGroups({bool? hideMessagesFromBlockedUsers, dynamic onSuccess(Map<String, int> result)?, dynamic onError(CometChatException excep)?}) → Future<Map<String, int>?>
Gives count of unread messages for every one-on-one and group conversation.
getUnreadMessageCountForAllUsers({bool? hideMessagesFromBlockedUsers, dynamic onSuccess(Map<String, int> result)?, dynamic onError(CometChatException excep)?}) → Future<Map<String, int>?>
Gives count of unread messages for every one-on-one and group conversation.
getUnreadMessageCountForGroup({required String guid, bool? hideMessagesFromBlockedUsers, dynamic onSuccess(Map<String, int> result)?, dynamic onError(CometChatException excep)?}) → Future<Map<String, int>?>
Gives count of unread messages for every one-on-one and group conversation.
getUser(String uid, {required dynamic onSuccess(User user)?, required dynamic onError(CometChatException excep)?}) → Future<User?>
Retrieve Particular User Details
getUserAuthToken() → Future<String?>
Get the current user's auth token.
init(String appId, AppSettings appSettings, {required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<void>
method initializes the settings required for CometChat
initializetestmessageStream() → void
@Deprecated - Platform channel stream initialization This method is deprecated and will be removed in a future version. Use native Dart stream subscriptions via _setupNativeStreamSubscriptions() instead.
initiateCall(Call call, {required dynamic onSuccess(Call call)?, required dynamic onError(CometChatException excep)}) → void
Initiates a call to a user or group.
isAIFeatureEnabled(String feature, {required dynamic onSuccess(bool isEnabled), required dynamic onError(CometChatException excep)}) → Future<void>
Check if a specific AI feature is enabled.
isExtensionEnabled(String extensionId, {dynamic onSuccess(bool)?, dynamic onError(CometChatException excep)?}) → Future<bool>
Checks if a CometChat extension is enabled.
isOfflineEnabled() → bool
Offline: whether offline messaging is actually running right now.
isPinConversationEnabled() → bool
Whether the Pin Conversation feature is enabled (features.ux.conversations.pinned.enabled).
isPinMessageEnabled() → bool
Whether the Pin Message feature is enabled (features.ux.messages.pinned.enabled).
isSaveMessageEnabled() → bool
Whether the Save Message feature is enabled (features.ux.messages.saved.enabled).
joinedAtForSession(String sessionID) → int
joinedAt in epoch seconds for sessionID, taken from the call cached by initiateCall / acceptCall.
joinGroup(String guid, String groupType, {String password = '', required dynamic onSuccess(Group group)?, required dynamic onError(CometChatException excep)?}) → Future<Group?>
Joins an existing group.
kickGroupMember({required String guid, required String uid, required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<String?>
Kicks a member from a group.
leaveGroup(String guid, {required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<void>
Leaves a group.
loadPubspecYaml() → Future<String>
login(String uid, String authKey, {required dynamic onSuccess(User user)?, required dynamic onError(CometChatException excep)?}) → Future<User?>
Use this function only for testing purpose. For production, use loginWithAuthToken
loginWithAuthToken(String authToken, {required dynamic onSuccess(User user)?, required dynamic onError(CometChatException excep)?}) → Future<User?>
Returns a User object after login in CometChat API.
logout({required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<void>
Method to log out the user from CometChat
markAsDelivered(BaseMessage message, {required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<void>
Mark the messages for a particular conversation as delivered .
markAsInteracted(int messageId, String interactedElementId, {required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<void>
Messages elements can be marked as interacted.
markAsRead(BaseMessage baseMessage, {required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<void>
Messages for both user and group conversations can be marked as read using this method.
markConversationAsDelivered(String conversationWithId, String conversationType, {required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<String?>
Marks all messages in a conversation as delivered.
markConversationAsRead(String conversationWithId, String conversationType, {required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<String?>
Marks all messages in a conversation as read.
markFeedItemAsDelivered(NotificationFeedItem feedItem, {required dynamic onSuccess(void result)?, required dynamic onError(CometChatException excep)?}) → Future<void>
Marks a single NotificationFeedItem as delivered.
markFeedItemAsRead(NotificationFeedItem feedItem, {required dynamic onSuccess(void result)?, required dynamic onError(CometChatException excep)?}) → Future<void>
Marks a single NotificationFeedItem as read.
markFeedItemsAsDelivered(List<NotificationFeedItem> feedItems, {required dynamic onSuccess(void result)?, required dynamic onError(CometChatException excep)?}) → Future<void>
Marks multiple NotificationFeedItems as delivered (batch).
markMessageAsUnread(BaseMessage baseMessage, {required dynamic onSuccess(Conversation conversation)?, required dynamic onError(CometChatException excep)?}) → Future<Conversation?>
Marks a BaseMessage as unread.
markPushNotificationClicked(PushNotification pushNotification, {required dynamic onSuccess(void result)?, required dynamic onError(CometChatException excep)?}) → Future<void>
Marks a push notification as clicked.
markPushNotificationDelivered(PushNotification pushNotification, {required dynamic onSuccess(void result)?, required dynamic onError(CometChatException excep)?}) → Future<void>
Marks a push notification as delivered.
onTypingIndicator() → Stream<TypingIndicator>
Returns a stream of TypingIndicator events for real-time typing status.
pinConversation(String conversationWith, String conversationType, {dynamic onSuccess(Conversation conversation)?, dynamic onError(CometChatException excep)?}) → Future<Conversation?>
Pin the logged-in user's conversation with a user or group so it surfaces at the top of the conversations list.
ping({required Function? onSuccess, required dynamic onError(CometChatException excep)?}) → Future<void>
Manual ping to check WebSocket connection.
pinMessage(int messageId, {dynamic onSuccess(BaseMessage)?, dynamic onError(CometChatException excep)?}) → Future<BaseMessage?>
Pin a message to its conversation.
registerTokenForPushNotification(String token, {required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<void>
Registers the obtained FCM Token which will be used by the CometChat server to send message via push notification.
rejectCall(String sessionID, String status, {required dynamic onSuccess(Call call)?, required dynamic onError(CometChatException excep)}) → void
Rejects an incoming call.
removeAIAssistantListener(String listenerId) → void
Call-SDK-changes
removeCallListener(String listenerId) → void
Call-SDK-changes
removeConnectionListener(String listenerId) → void
Remove Connection Listener
removeConversationListener(String listenerId) → void
Removes a previously registered ConversationListener. Call in dispose().
removeGroupListener(String listenerId) → void
Remove Group Listener
removeLoginListener(String listenerId) → void
Remove Login Listener
removeMediaDownloadListener(String id) → void
removeMessageListener(String listenerId) → void
To remove message listener
removeNotificationFeedListener(String listenerId) → void
Remove a previously registered NotificationFeedListener.
removeOfflineCacheResetListener(String id) → void
removeOfflineMessageListener(String id) → void
removeReaction(int messageId, String reaction, {required dynamic onSuccess(BaseMessage)?, required dynamic onError(CometChatException excep)?}) → Future<BaseMessage?>
Remove a reaction from a message.
removeSyncListener(String id) → void
Offline: unregister a SyncListener by id.
removeUserListener(String listenerId) → void
Remove User Listener
reportFeedEngagement(NotificationFeedItem feedItem, String interactionString, {required dynamic onSuccess(void result)?, required dynamic onError(CometChatException excep)?}) → Future<void>
Reports engagement for a NotificationFeedItem with a given interaction string.
retryAllFailedMessages() → Future<void>
Offline: retry all failed sends. Outcomes are reported through the global offline-message listener (see addOfflineMessageListener).
retryMessage(String localMessageId, {required MessageSentListener listener}) → Future<void>
Offline: retry a single failed send. listener (required) receives the outcome (onMessageSent / onError) — retry does not otherwise emit the normal pending/sent callbacks. No-op when offline is disabled.
saveMessage(int messageId, {dynamic onSuccess(BaseMessage)?, dynamic onError(CometChatException excep)?}) → Future<BaseMessage?>
Save (bookmark) a message for the logged-in user.
sendCustomMessage(CustomMessage message, {MessageSentListener? listener, dynamic onSuccess(CustomMessage message)?, dynamic onError(CometChatException excep)?}) → Future<CustomMessage?>
send custom messages which are neither text nor media messages.
sendInteractiveMessage(InteractiveMessage message, {MessageSentListener? listener, dynamic onSuccess(InteractiveMessage message)?, dynamic onError(CometChatException excep)?}) → Future<InteractiveMessage?>
Marks a message as unread.
sendMediaMessage(MediaMessage mediaMessage, {MessageSentListener? listener, dynamic onSuccess(MediaMessage message)?, dynamic onError(CometChatException excep)?}) → Future<MediaMessage?>
send a media message like photos, videos & files.
sendMessage(TextMessage message, {MessageSentListener? listener, dynamic onSuccess(TextMessage message)?, dynamic onError(CometChatException excep)?}) → Future<TextMessage?>
To send a text message to a single user or group. returns the TextMessage with message id
sendMessageWithListener(BaseMessage message, {required MessageSentListener listener}) → Future<void>
sendTransientMessage(TransientMessage message, {required dynamic onSuccess()?, required dynamic onError(CometChatException excep)?}) → Future<void>
Transient messages are messages that are sent in real-time only
setDemoMetaInfo({required Map<String, String> jsonObject}) → Future<void>
Set demo metadata information.
setIntegrationSource(String source) → Future<void>
Sets the integration source for telemetry attribution.
setPlatformParams({required String platform, required String sdkVersion}) → Future<void>
Set platform parameters (platform name and SDK version).
setSource(String resource, String platform, String language) → Future<void>
Sets SDK source metadata.
startTyping({required String receiverUid, required String receiverType}) → Future<void>
method to inform the receiver that the logged in user has started typing.
subscribeToThread(int parentMessageId, {dynamic onSuccess(String result)?, dynamic onError(CometChatException excep)?}) → Future<String?>
Subscribes the logged-in user to the thread rooted at parentMessageId, so they are notified about replies that arrive in future — allowed even on a message with zero replies.
tagConversation(String conversationWith, String conversationType, List<String> tags, {required dynamic onSuccess(Conversation conversation)?, required dynamic onError(CometChatException excep)?}) → Future<Conversation?>
Tag a conversation
transferGroupOwnership({required String guid, required String uid, required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<String?>
Transfers group ownership to another member.
unbanGroupMember({required String guid, required String uid, required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<String?>
Unbans a member from a group.
unblockUser(List<String>? uids, {required dynamic onSuccess(Map<String, dynamic> map)?, required dynamic onError(CometChatException excep)?}) → Future<Map<String, dynamic>?>
Un-block a user from sending logged-in user any messages.
unpinConversation(String conversationWith, String conversationType, {dynamic onSuccess(Conversation conversation)?, dynamic onError(CometChatException excep)?}) → Future<Conversation?>
Unpin the logged-in user's conversation. Only a pin placed by the logged-in user can be removed — an app_system pin is rejected server-side. Returns the updated Conversation with the pin fields cleared to null. This device fires ConversationListener.onConversationUnpinned once for its own call, before onSuccess, as do the user's other devices. 5.1.0 keeps the 5.0.9 same-device callback for UI Kit compatibility; see BEH-FLAG-04.
unpinMessage(int messageId, {dynamic onSuccess(BaseMessage)?, dynamic onError(CometChatException excep)?}) → Future<BaseMessage?>
Unpin a message from its conversation. Same permission model and idempotency as pinMessage; the returned message carries the pin fields cleared to null. This device fires MessageListener.onMessageUnpinned once for its own call, before onSuccess, as do other members. 5.1.0 keeps the 5.0.9 same-device callback for UI Kit compatibility; see BEH-FLAG-04.
unsaveMessage(int messageId, {dynamic onSuccess(BaseMessage)?, dynamic onError(CometChatException excep)?}) → Future<BaseMessage?>
Unsave a message for the logged-in user. Same semantics as saveMessage; the returned message carries savedAt cleared to null. This device fires MessageListener.onMessageUnsaved once for its own call, before onSuccess, as do the user's other devices. 5.1.0 keeps the 5.0.9 same-device callback for UI Kit compatibility; see BEH-FLAG-04.
unsubscribeFromThread(int parentMessageId, {dynamic onSuccess(String result)?, dynamic onError(CometChatException excep)?}) → Future<String?>
Unsubscribes the logged-in user from the thread rooted at parentMessageId.
updateCurrentUserDetails(User user, {required dynamic onSuccess(User user)?, required dynamic onError(CometChatException excep)?}) → Future<User?>
Updating a logged-in user is similar to updating a user
updateGroup({required Group group, required dynamic onSuccess(Group group)?, required dynamic onError(CometChatException excep)?}) → Future<Group?>
Updates group details.
updateGroupMemberScope({required String guid, required String uid, required String scope, required dynamic onSuccess(String result)?, required dynamic onError(CometChatException excep)?}) → Future<String?>
Updates a group member's scope (role).
updateUser(User user, String apiKey, {required dynamic onSuccess(User user)?, required dynamic onError(CometChatException excep)?}) → Future<User?>
Updating a user similar to creating a user should ideally be achieved at your backend using the Restful APIs