tencent cloud

Feedback

Flutter

Last updated: 2024-10-29 11:02:03

    Initialization and Login APIs

    To use the Tencent Cloud Chat service, you need to initialize the SDK and log in.
    API
    Description
    Initializes the SDK.
    Uninitializes the SDK.
    Logs in.
    Logs out.
    Gets the UserID of the current login user.
    Gets the login status.
    Gets the current server time (not supported on web).
    Gets the version number.
    Conversation feature entry.
    Contacts feature entry.
    Advanced group feature entry.
    Advanced message feature entry.
    Gets the version number.
    Signaling entry.

    Signaling APIs

    API
    Description
    Adds a signaling listener.
    Removes a signaling listener.
    Invites a user.
    Invites certain users in the group.
    The inviter cancels the invitation.
    The invitee accepts the invitation.
    The invitee rejects the invitation.
    Gets signaling information.
    Creates a signaling request.

    Message Creation APIs

    After a message is created, an id field will be returned. You can pass in the id field and related information to the message sending API (sendMessage) to send the message.
    API
    Description
    Creates a text message.
    Creates a custom message.
    Creates an image message.
    Creates an audio message.
    Creates a video message.
    Creates an @ text message.
    Creates a file message.
    Creates a location message.
    Creates an emoji message.
    Creates a combined message.
    Creates a forward message.
    Creates a targeted group message.
    Adds a multi-element message.

    Message Sending and Receiving APIs

    If you need to send or receive rich media messages (such as image, video, and file messages) and use advanced features such as recalling messages, marking messages as read, and querying message history, we recommend the following advanced message APIs. (The original APIs for simple message sending and receiving used by v3.6.0 and earlier versions have been disused. Please use new APIs to create and send messages.)
    API
    Description
    Sets an event listener for advanced messages.
    Removes the event listener for advanced messages.
    Gets historical one-to-one (C2C) messages.
    Gets historical messages (advanced API).
    Gets historical group messages.
    Marks one-to-one (C2C) messages as read.
    Marks group messages as read.
    Marks all messages as read.
    Deletes a message from the local storage.
    Deletes local and roaming messages.
    Adds a message to the message list of a group chat.
    Adds a message to the message list of a one-to-one chat.
    Clears the chat history with a user from local storage and the cloud (without deleting the conversation).
    Clears the chat history of a group from local storage and the cloud (without deleting the conversation).
    Gets the sub messages of a combined message.
    Resends a message.
    Sets the one-to-one message receiving option for a user (batch setting supported).
    Queries the one-to-one message receiving option of a user.
    Modifies the group message receiving option.
    Sets custom message data (saved locally, will not be sent to the peer end, and will become invalid after the app is uninstalled and reinstalled).
    Sets custom message data and marks whether a voice or video message is played (such a message will be saved locally, not be sent to the peer end, and become invalid after the app is uninstalled and reinstalled).
    Recalls a message. By default, you can recall only messages that are sent within two minutes. You can customize the time limit for message recall via the console (Feature Configuration > Login and Message > Message Recall Settings).
    Modifies a message.
    Sends a message.
    Sends a reply message.
    Searches for local messages.
    Sends group message read receipts.
    Gets read receipts for messages sent by yourself.
    Gets the list of members who have (or have not) read a message sent by yourself.

    Group APIs

    Tencent Cloud Chat SDK supports five preset group types, each of which pertains to different scenarios.
    Work group (Work): users can join the group only after being invited by group members. This group type is the same as private group (Private) in earlier versions.
    Public group (Public): Users can join a public group through requests, which need to be approved by the group owner or group admin.
    Meeting group (Meeting): used together with TRTC to enable scenarios such as video conferencing and online education. Users can join and leave the group freely and view the message history before they join. Same as chat room (ChatRoom) in earlier versions.
    Community: A user can join and leave a community freely. It is suitable for chat scenarios with a super large number of community members, such as knowledge sharing and game discussion. This feature is supported by a client with the SDK enhanced edition v5.8.1668 or later and the web SDK v2.17.0 or later. To use it, you need to purchase the Premium edition, and then enable it in Console, path: Applications > Your App > Chat > Configuration > Group Configuration > Community.
    Audio-video group (AVChatRoom): An audio-video group allows users to join and leave freely and is suitable for scenarios such as live streaming and chat rooms with on-screen comments. There is no limit on the number of group members.
    API
    Description
    Adds an event listener for groups.
    Sets an event listener for groups.
    Removes an event listener for groups.
    Creates a group (advanced). The group information and the initial group members can be set during group creation.
    Joins a group.
    Leaves a group.
    Deletes a group. Only the group owner and group admin can delete the group.
    Gets the list of groups the current user has joined, excluding audio-video groups.
    Gets the profiles of groups.
    Modifies the profile of a group.
    Initializes group attributes. This will clear the existing group attribute list.
    Sets group attributes. If the group attributes already exist, their values are updated. Otherwise, the group attributes are added.
    Deletes specified group attributes. Passing in null for keys means clearing all group attributes.
    Gets specified group attributes. Passing in null for keys means getting all group attributes.
    Searches for groups.
    Gets the number of online users in a group. (This API is currently supported only by audio-video groups.)
    Gets the group member list.
    Gets the profiles of specified group members.
    Modifies the profile of a specified group member.
    Searches for group members.
    Mutes a group member.
    Removes members from a group.
    Sets a role for a group member.
    Transfers the ownership of a group.
    Invites users to a group.
    Gets the list of requests to join a group.
    Accepts a request to join a group.
    Rejects a request to join a group.
    Marks the request list as read.
    Gets the list of community groups the current user has joined.
    Creates a topic.
    Deletes a topic.
    Sets topic attributes.
    Gets the topics of a group.

    Conversation List APIs

    The conversation list is the list a user sees on the first screen after login. It includes elements such as conversation node, conversation name, group name, last message, and unread count.
    API
    Description
    Adds a contacts listener.
    Removes a contacts listener.
    Sets a conversation listener.
    Gets the conversation list.
    Gets the list of specified conversations by conversation IDs.
    Pins a conversation to the top.
    Gets the total unread message count of a conversation.
    Gets a specified conversation.
    Deletes a conversation.
    Sets a draft for a conversation.

    User Profile APIs

    You can use the following APIs to query user profiles, modify your profile, and block messages from a specified user (that is, adding a specified user to the blocklist).
    API
    Description
    Gets user profiles.
    Gets users' online statuses.
    Modifies one's own user profile.
    Sets the status of the current logged-in user.
    Blocks messages from a user, which means adding the user to the blocklist.
    Unblocks messages from a user, which means removing the user from the blocklist.
    Gets the blocklist.

    Offline Push APIs

    We recommend you use the offline push service if you want your app to receive Chat service messages in real time when it runs in the background. As there is no unified push service in the Chinese mainland, you need to configure Android offline push for devices of different vendors separately.
    API
    Description
    Sets the APNs offline push listener.
    Configures offline push.
    Configures offline push.
    Configures offline push.

    Friend Management APIs

    Tencent Cloud Chat SDK does not check friend relationships by default when sending and receiving messages. To achieve the interactive experience of "add friends first, then send messages", you can log in to the Console to modify Relationship Check. When enabled, users can only send messages to their friends. When a user sends a message to a non-friend, SDK will report a 20009 error code. The configuration path is: Applications > Your App > Chat > Configuration > Login and Message > Relationship Check.
    Use the following API to add or delete friends and manage friend lists.
    API
    Description
    Sets a contacts listener to receive friend and blocklist change events.
    Adds a contacts listener.
    Removes a contacts listener.
    Gets the contacts.
    Gets the profiles of specified friends.
    Sets the profile of a specified friend.
    Adds a friend.
    Deletes friends.
    Checks your relationship with a specified user.
    Gets the list of friend requests.
    Accepts a friend request.
    Rejects a friend request.
    Deletes a friend request.
    Marks a friend request as read.
    Creates a friend list.
    Gets the information of friend lists.
    Deletes a friend list.
    Modifies the name of a friend list.
    Adds friends to a friend list.
    Deletes friends from a friend list.
    Searches for friends.