logo
In-app Chat
On this page

Class

2026-01-21
ZIMZIMCacheConfig
ZIMCommandMessageZIMConversation
ZIMConversationBaseInfoZIMConversationChangeInfo
ZIMConversationDeleteConfigZIMConversationFilterOption
ZIMConversationQueryConfigZIMConversationTotalUnreadMessageCountQueryConfig
ZIMCustomMessageZIMCustomMessageLiteInfo
ZIMErrorZIMEventHandler
ZIMLogConfigZIMMediaMessageSendNotification
ZIMMessageZIMMessageLiteInfo
ZIMMessageReactionZIMMessageReactionUserQueryConfig
ZIMMessageRepliedListQueryConfigZIMMessageSendNotification
ZIMRoomFullInfoZIMRoomInfo
ZIMRoomMemberQueryConfigZIMTextMessage
ZIMTextMessageLiteInfoZIMTipsMessage
ZIMUserFullInfoZIMUserInfo

ZIM

Details

ZIM SDK main class.

Declared in ZIM.h

Methods

create

static
create
deprecated
public ZIM * create(unsigned int appID)
Create a ZIM instance.
Declared in ZIM.h

Parameters

NameTypeDescription
appIDunsigned intApplication ID issued by ZEGO for developers, please contact ZEGO technical support to apply.
  • Platform differences: When calling this function under the Android platform, in addition to the appID, the Application class object must also be passed in.
Deprecated
This function is deprecated in version 2.3.0, please use another method with the same name [create]

Return

ZIM instance.

create

static
create
public ZIM * create(ZIMAppConfig appConfig)
Create a ZIM instance.
Declared in ZIM.h

Parameters

NameTypeDescription
appConfigZIMAppConfigAppID and appSign issued by ZEGO for developers, Please apply at the ZEGO console.
  • When to call: Before calling other member functions, you must call this API to create a ZIM example.

Usage restrictions: Currently only one instance is supported, repeated calls will return [null].

Precautions:

  1. Currently, the [create] function can only create one instance at most. If it is called multiple times, only the first one will return a valid instance, and the rest will be [null]. The developer should save the ZIM instance by himself, and ensure that the life cycle of the instance is available in the process of using the ZIM business function; or after calling [create], he can use [getInstance] to obtain its singleton object and call other member functions.

  2. If you use this function to create an instance, you must pass in both AppID and AppSign (exclude Web platform).

Scope of Impact: Failure to call this function will prevent other member functions from being called.

Platform difference: When calling this function on the Android platform, in addition to the appID, the Application class object must also be passed in.

Return

ZIM instance.

getVersion

static
getVersion
public std::string getVersion()
Gets the SDK's version number.
Declared in ZIM.h

Get the SDK version.

  • Use cases: 1. When the SDK is running, the developer finds that it does not match the expected situation and submits the problem and related logs to the ZEGO technical staff for locating. The ZEGO technical staff may need the information of the engine version to assist in locating the problem.
  1. Developers can also collect this information as the version information of the engine used by the app, so that the SDK corresponding to each version of the app on the line.

When to call : It can be called at any time.

  • Available since: 1.1.0.

SDK version.

getInstance

static
getInstance
public ZIM * getInstance()
Get the ZIM singleton object.
Declared in ZIM.h
  • When to call: You must call [create] to create an instance before calling this function to obtain a singleton object, otherwise it will return [null].

Related interface: [create].

setLogConfig

static
setLogConfig
public void setLogConfig(const ZIMLogConfig & config)
Set log related configuration.
Declared in ZIM.h

Parameters

NameTypeDescription
configconst ZIMLogConfig &Log configuration object.
  • When to call: It must be called before [create].

If the developer calls after [create], the SDK will save this configuration until the next time [create] takes effect.

Life cycle: Set before calling [create], and take effect when calling [create]. If the developer does not set a new log configuration in the next [create], the previous configuration will still take effect.

Platform difference: The default path of different platforms is different, please refer to the default value.

Related reference: For details, please refer to https://doc-zh.zego.im/faq/IM_sdkLog?product=IM&platform=all.

setGeofencingConfig

static
setGeofencingConfig
public bool setGeofencingConfig(const std::vector\<int> areaList, ZIMGeofencingType type)
Set geofence-related configurations.
Declared in ZIM.h

Parameters

NameTypeDescription
areaListconst std::vector<int>List of geo-fenced areas. Set at least 1 area, and the maximum number of settings cannot be greater than the number supported by the SDK.
typeZIMGeofencingTypeType of geo-fenced area.

Details

Geofencing means that instant messaging data transmission is limited to a certain area to meet regional data privacy and security regulations, that is, to restrict access to communication services in a specific area.

  • When to call /Trigger: The [setGeofencingConfig] interface needs to be called before the [create] interface.
  • Caution: If you need to update geo fencing information, please call the [destroy] interface to destroy the current ZIM instance, and then call this interface.
  • Available since: 2.12.0 and above.
  • Restrictions: If you need to use this function, please contact ZEGO technical support.

Return

Geofencing setup results.

setCacheConfig

static
setCacheConfig
public void setCacheConfig(const ZIMCacheConfig & config)
Set cache related configuration.
Declared in ZIM.h

Parameters

NameTypeDescription
configconst ZIMCacheConfig &Cache configuration object.
  • Default value: Android:/storage/Android/data/[packageName]/files/ZIMCaches iOS:/Library/Caches/ZIMCaches macOS:(sandbox)/Library/Containers/[Bundle ID]/Data/Library/Caches/ZIMCaches / ~/Library/Caches/ZIMCaches Windows:C:\Users[Your UserName]\AppData[App Name]ZEGO.SDK\ZIMCaches

Call timing: It must be called before [create].

If the developer calls after [create], the SDK saves the configuration until it takes effect the next time [Create] is invoked.

  • Related callbacks: In addition to getting the login result in the callback parameter, the developer will also receive the [onConnectionStateChanged] callback during the login request and after the login is successful/failed to determine the current user's login status.

Life cycle: Set before calling [create] and takes effect when calling [create]. If the developer does not set the new caches configuration the next time [create] is created, the previous configuration will still take effect.

Platform difference: The default path varies with platforms. Please refer to the default value.

addFriend

addFriend
public void addFriend(std::string userID, const ZIMFriendAddConfig & config, ZIMFriendAddedCallback callback)
Add friends directly.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDstd::stringuser ID.
configconst ZIMFriendAddConfig &Add a friend related Configuration.
callbackZIMFriendAddedCallbackAdd a friend result callback.

Details

Through this interface, a user with the specified userID can be added to the friend list.

  • When to call /Trigger: It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks: [onFriendListChanged].
  • Available since: 2.14.0 or above.

Return

Add a friend result callback.

sendFriendApplication

sendFriendApplication
public void sendFriendApplication(std::string userID, const ZIMFriendApplicationSendConfig & config, ZIMFriendApplicationSentCallback callback)
Send a friend application.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDstd::stringuser ID.
configconst ZIMFriendApplicationSendConfig &Send friend application for related configuration.
callbackZIMFriendApplicationSentCallbackSend friend application result callback.
  • When to call: It can be called after creating a ZIM instance through [create].
  • Related callbacks: [onFriendApplicationListChanged].

Return

Send friend application result callback.

deleteFriends

deleteFriends
public void deleteFriends(const std::vector\<std::string> userIDs, const ZIMFriendDeleteConfig & config, ZIMFriendsDeletedCallback callback)
Delete friends.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsconst std::vector<std::string>List of user IDs to delete.
configconst ZIMFriendDeleteConfig &Delete friends related Configuration.
callbackZIMFriendsDeletedCallbackDelete friends result callback.

Details

Through this interface, the specified user can be deleted from the friend list.

  • When to call /Trigger: It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks: [onFriendListChanged].
  • Available since: 2.14.0 or above.

Return

Delete friends result callback.

checkFriendsRelation

checkFriendsRelation
public void checkFriendsRelation(const std::vector\<std::string> & userIDs, const ZIMFriendRelationCheckConfig & config, ZIMFriendsRelationCheckedCallback callback)
Check friend relationships.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsconst std::vector<std::string> &List of user IDs to check.
configconst ZIMFriendRelationCheckConfig &Check the configuration related to friend relationships.
callbackZIMFriendsRelationCheckedCallbackCheck the friend relationship result callback.

Details

支持版本:2.14.0 及以上。

详情描述:通过该接口可以检查与指定用户之间的好友关系。

调用时机:必须在调用 [create] 创建实例之后,调用 [login] 登录后才可使用。

相关回调:[ZIMFriendsRelationCheckedCallback]。

Return

Check the friend relationship result callback.

updateFriendAlias

updateFriendAlias
public void updateFriendAlias(std::string friendAlias, std::string userID, ZIMFriendAliasUpdatedCallback callback)
Update friend alias.
Declared in ZIM.h

Parameters

NameTypeDescription
friendAliasstd::stringFriend alias.
userIDstd::stringUser ID.
callbackZIMFriendAliasUpdatedCallbackUpdate a friend alias result callback.

Details

Through this interface, the specified userID user can update the alias.

  • When to call /Trigger: It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks: [ZIMFriendAliasUpdatedCallback].
  • Available since: 2.14.0 or above.

Return

Update a friend alias result callback.

updateFriendAttributes

updateFriendAttributes
public void updateFriendAttributes(std::unordered_map<std::string, std::string> friendAttributes, std::string userID, ZIMFriendAliasUpdatedCallback callback)
Update friend attributes.
Declared in ZIM.h

Parameters

NameTypeDescription
friendAttributesstd::unordered_map<std::string, std::string>Friend attributes. Up to 5 can be set. The key of the attribute can only be selected from k0 to k4.
userIDstd::stringUser ID.
callbackZIMFriendAliasUpdatedCallbackUpdate a friend attributes result callback.

Details

Through this interface, the specified userID user can update the attributes.

  • When to call /Trigger: It is available only after calling [create] to create the instance and then calling [login] to login.
  • Available since: 2.14.0 or above.

Return

Update a friend attributes result callback.

acceptFriendApplication

acceptFriendApplication
public void acceptFriendApplication(std::string userID, const ZIMFriendApplicationAcceptConfig & config, ZIMFriendApplicationAcceptedCallback callback)
Accept to friend request.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDstd::stringUser ID.
configconst ZIMFriendApplicationAcceptConfig &Accept friend application configuration.
callbackZIMFriendApplicationAcceptedCallbackAccept the result callback of friend application.

Details

After receiving the friend application, accept the friend application through this interface.

  • When to call /Trigger: It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks: [ZIMFriendApplicationAcceptedCallback].
  • Available since: 2.14.0 or above.

Return

Accept the result callback of friend application.

rejectFriendApplication

rejectFriendApplication
public void rejectFriendApplication(std::string userID, const ZIMFriendApplicationRejectConfig & config, ZIMFriendApplicationRejectedCallback callback)
Accept to friend request.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDstd::stringUser ID.
configconst ZIMFriendApplicationRejectConfig &Reject friend application configuration.
callbackZIMFriendApplicationRejectedCallbackReject the result callback of friend application.

Details

After receiving the friend application, reject the friend application through this interface.

  • When to call /Trigger: It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks: [ZIMFriendApplicationRejectedCallback].
  • Available since: 2.14.0 or above.

Return

Reject the result callback of friend application.

queryFriendsInfo

queryFriendsInfo
public void queryFriendsInfo(std::vector\<std::string> userIDs, ZIMFriendsInfoQueriedCallback callback)
Query friend information in batches.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsstd::vector<std::string>User ID list.
callbackZIMFriendsInfoQueriedCallbackResult callback for querying friend information in batches.

Details

If you need to query the information of a group of designated friends for display, you can query it through this interface.

  • When to call /Trigger: It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks: [ZIMFriendListQueriedCallback].
  • Available since: 2.14.0 or above.

Return

Result callback for querying friend information in batches.

queryFriendList

queryFriendList
public void queryFriendList(const ZIMFriendListQueryConfig & config, ZIMFriendListQueriedCallback callback)
Query the friends list.
Declared in ZIM.h

Parameters

NameTypeDescription
configconst ZIMFriendListQueryConfig &Query the configuration of the friend list.
callbackZIMFriendListQueriedCallbackThe returned result of querying the friends list.

Details

The list of friends that need to be paged can be queried through this interface.

  • When to call /Trigger: It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks: [ZIMFriendListQueriedCallback].
  • Available since: 2.14.0 or above.

Return

Query the friend list and return results.

queryFriendApplicationList

queryFriendApplicationList
public void queryFriendApplicationList(const ZIMFriendApplicationListQueryConfig & config, ZIMFriendApplicationListQueriedCallback callback)
Query the friend application list.
Declared in ZIM.h

Parameters

NameTypeDescription
configconst ZIMFriendApplicationListQueryConfig &Query the friend application list configuration.
callbackZIMFriendApplicationListQueriedCallbackQuery the returned results of the friend application list.

Details

If you need to paginate to query the list of friend applications, you can query through this interface.

  • When to call /Trigger: It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks: [ZIMFriendApplicationListQueriedCallback].
  • Available since: 2.14.0 or above.

Return

Query the returned results of the friend application list.

searchLocalFriends

searchLocalFriends
public void searchLocalFriends(const ZIMFriendsSearchConfig & config, ZIMFriendsSearchedCallback callback)
Search local friends.
Declared in ZIM.h

Parameters

NameTypeDescription
configconst ZIMFriendsSearchConfig &Friends search configuration.
callbackZIMFriendsSearchedCallbackSearch local friend information and return results.

Details

Through this interface, you can search for local friend information based on keywords.

  • When to call /Trigger: It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks: [ZIMFriendsSearchedCallback].
  • Available since: 2.14.0 or above.

Return

Search local friend information and return results.

addUsersToBlacklist

addUsersToBlacklist
public void addUsersToBlacklist(const std::vector<std::string> & userIDs, ZIMBlacklistUsersAddedCallback callback)
Add users to blacklist.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsconst std::vector<std::string> &The list of userIDs to be added to blacklist.
callbackZIMBlacklistUsersAddedCallbackCallback for operation results of adding users to the blacklist.

Details

Through this interface, a user with the specified userID can be added to the blacklist.

  • When to call /Trigger: It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks: [ZIMBlacklistUsersAddedCallback].

Usage restrictions: The number of userID passed in at one time cannot exceed 20.

  • Available since: 2.13.0 or above.

removeUsersFromBlacklist

removeUsersFromBlacklist
public void removeUsersFromBlacklist(const std::vector<std::string> & userIDs, ZIMBlacklistUsersRemovedCallback callback)
Remove the user from the blacklist.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsconst std::vector<std::string> &userID list.
callbackZIMBlacklistUsersRemovedCallbackThe callback result of the operation to remove the user from the blacklist.

Details

Through this interface, the user with the specified userID can be removed from the blacklist.

  • When to call /Trigger: It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks: [ZIMBlacklistUsersRemovedCallback].

Usage restrictions: The number of userID passed in at one time cannot exceed 20.

  • Available since: 2.13.0 or above.

queryBlacklist

queryBlacklist
public void queryBlacklist(const ZIMBlacklistQueryConfig & config, ZIMBlacklistQueriedCallback callback)
Query the blacklist.
Declared in ZIM.h

Parameters

NameTypeDescription
configconst ZIMBlacklistQueryConfig &Query the blacklist configuration.
callbackZIMBlacklistQueriedCallbackQuery the blacklist result callback.

Details

Query the blacklist.

  • When to call /Trigger: It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks: [ZIMBlacklistQueriedCallback].
  • Available since: 2.13.0 or above.

checkUserIsInBlacklist

checkUserIsInBlacklist
public void checkUserIsInBlacklist(const std::string & userID, ZIMBlacklistCheckedCallback callback)
Check if the user is on the blacklist.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDconst std::string &The user ID information that needs to be checked is required.
callbackZIMBlacklistCheckedCallbackBlacklist check result callback.

Details

Through this interface, you can check whether a certain userID is on the blacklist.

  • When to call /Trigger: It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks: [ZIMBlacklistCheckedCallback].
  • Available since: 2.13.0 or above.

querySubscribedUserStatusList

querySubscribedUserStatusList
public void querySubscribedUserStatusList(ZIMSubscribedUserStatusQueryConfig config, ZIMSubscribedUserStatusListQueriedCallback callback)
This command is used to query the user status subscription list of the current user.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMSubscribedUserStatusQueryConfigQuery the parameters related to the subscription list.
callbackZIMSubscribedUserStatusListQueriedCallbackResult callback of querying the subscription list.

Details

This command is used to query the user status subscription list of the current user.

  • Use cases: Through this interface, you can obtain the local cache of the user status subscription list of the current user, so that you can know which users the current user has subscribed to, obtain the subscription expiration time of the subscriber, and obtain the status data of the subscriber when it changed last time.
  • When to call /Trigger: It can be called after login, regardless of network status.
  • Related callbacks: ZIMSubscribedUserStatusListQueriedCallback、subscribeUsersStatus、unsubscribeUsersStatus.
  • Related APIs: subscribeUsersStatus、unsubscribeUsersStatus.
  • Available since: 2.18.0
  • Restrictions: The data obtained is the local cache of the SDK. When the network conditions are good after login, the SDK periodically synchronizes data to the background.

Return

Result callback.

queryUsersStatus

queryUsersStatus
public void queryUsersStatus(const std::vector\<std::string\> & userIDs, ZIMUsersStatusQueriedCallback callback)
Query the user statuses of other users.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsconst std::vector<std::string> &The query target user list.
callbackZIMUsersStatusQueriedCallbackCallback method for querying user status.

Details

Query the user statuses of other users.

  • Use cases: When you do not need to continuously follow the user statuses of certain users but only need to obtain their user statuses once, you can use this method.
  • When to call /Trigger: Can be called after login and when the network conditions are good.

The query targets can not include unregistered users.

  • Related callbacks: ZIMUsersStatusQueriedCallback.
  • Available since: 2.18.0

Return

Result callback.

subscribeUsersStatus

subscribeUsersStatus
public void subscribeUsersStatus(const std::vector\<std::string\> & userIDs, ZIMUserStatusSubscribeConfig config, ZIMUsersStatusSubscribedCallback callback)
Subscribe to the user status of other users
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsconst std::vector<std::string> &List of subscribed users.
configZIMUserStatusSubscribeConfigSubscribe to the relevant configuration items.
callbackZIMUsersStatusSubscribedCallbackThe operation callback of the user status subscription.

Details

Subscribing to the user status of other users through this interface.

  • Use cases: When you enter the group/room/friends list and need to know which room/group members/friends are online, subscribe through this interface. When the user status of these users is updated successfully, the [onUserStatusUpdated] interface is updated.
  • When to call /Trigger: Can be called when the login is successful and the network conditions are good.
  • Caution: You cannot subscribe to the current login user through this interface. The subscribed user must be registered.
  • Related callbacks: [ZIMUsersStatusSubscribedCallback],[onUserStatusUpdated]
  • Related APIs: [unsubscribeUsersStatus]
  • Available since: 2.18.0
  • Restrictions: The maximum number of subscribers is 100. By default, a single user can subscribe to a maximum of 3000 users. When the number of subscribers reaches the upper limit, the new subscribers will overwrite the original subscribers.

Return

Result callback.

unsubscribeUsersStatus

unsubscribeUsersStatus
public void unsubscribeUsersStatus(const std::vector\<std::string\> & userIDs, ZIMUsersStatusUnsubscribedCallback callback)
This command is used to batch unsubscribe the target users in the current user subscription list.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsconst std::vector<std::string> &List of users that have been canceled in batch.
callbackZIMUsersStatusUnsubscribedCallbackCallback of the operation result of batch cancellation.

Details

Batch unsubscribe the target user in the current user subscription list.

  • Use cases: In non-multi-terminal login scenarios, when you leave a room or group, if you no longer follow the user status of the room or group members for a short period of time, and you have subscribed to the user status of the room or group members when you enter the room or group, you can unsubscribe through this interface.
  • When to call /Trigger: Called after login and when the network is in good condition.
  • Caution: You cannot cancel a user that is not in the current user subscription list.
  • Related callbacks: ZIMUsersStatusUnsubscribedCallback.
  • Related APIs: subscribeUsersStatus、queryUsersStatus、querySubscribedUserStatusList.
  • Available since: 2.18.0
  • Restrictions: The maximum number of userids passed in at a time is 100.

Return

Result callback.

updateUserCustomStatus

updateUserCustomStatus
public ZIMUserCustomStatusUpdatedResult updateUserCustomStatus(String customStatus, ZIMUserCustomStatusUpdatedCallback callback)
It is used to update the user-defined status.
Declared in ZIM.h

Parameters

NameTypeDescription
customStatusStringDescription: User-defined status. The default maximum value is 64 bytes. The default expiration time is 1 day. At login, if the field is an empty string (which is the default), the current user's custom state is not modified.
callbackZIMUserCustomStatusUpdatedCallbackThe callback of the custom status update.

Details

You can define the status, such as DND and Busy, based on your service requirements.

  • Use cases: After login, call the interface to modify the current user's custom status as "do not disturb", "busy" and other states.
  • When to call /Trigger: After an online login and a network connection exists.
  • Related callbacks: After the interface is successfully invoked to update the user-defined status, other devices that are logged in to multiple devices and users who subscribe to the current user status through subscribeUsersStatus receive onUserStatusUpdated and updates the user-defined status of the current user.
  • Available since: 2.20.0 and later.
  • Restrictions: 1 time/second

Return

The result of the custom status update.

updateUserOfflinePushRule

updateUserOfflinePushRule
public void updateUserOfflinePushRule(ZIMUserOfflinePushRule offlinePushRule, ZIMUserOfflinePushRuleUpdatedCallback callback)
Modify the custom rule of offline push
Declared in ZIM.h

Parameters

NameTypeDescription
offlinePushRuleZIMUserOfflinePushRuleThe user pushes the rule information offline, and the interface will be fully updated with the member properties of the input object each time the interface is called.
callbackZIMUserOfflinePushRuleUpdatedCallbackModify the result callback of offline push.

Details

This interface is used to modify the custom rule of offline push for the current user.

  • Use cases: For example, in the multi-terminal login scenario, the developer hopes that when the desktop is online, the mobile terminal does not want to receive offline push. In this scenario, the interface can be invoked to achieve this function.
  • When to call /Trigger: You can call it after you log in and the network is in good condition.
  • Caution: After the interface is successfully invoked, all ends will receive onUserRuleUpdate notifying the user that the rule has been updated.
  • Related callbacks: onUserRuleUpdate、ZIMUserOfflinePushRuleUpdatedCallback
  • Related APIs: querySelfUserInfo
  • Available since: 2.15.0 and later versions.

Return

Modify the result callback of offline push.

querySelfUserInfo

querySelfUserInfo
public void querySelfUserInfo(ZIMSelfUserInfoQueriedCallback callback)
Query user information and user rules.
Declared in ZIM.h

Parameters

NameTypeDescription
callbackZIMSelfUserInfoQueriedCallbackCallback result of querying user information and user rules.

Details

Query information about the current user and user rules. In offline state, you can query local data.

  • Use cases: If you need to display the user information and rules, you can invoke the query, for example, to enter the personal page of the current user.
  • When to call /Trigger: Call after login.
  • Available since: 2.15.0 及以后版本。
  • Restrictions: ZIMSelfUserInfoQueriedCallback、userInfoUpdated、userRuleUpdated

Return

Callback result of querying user information and user rules.

setEventHandler

setEventHandler
public void setEventHandler(std::shared_ptr<ZIMEventHandler> handler)
Set the event notification callbacks that need to be handled. If the eventHandler is set to [null], all the callbacks set previously will be cleared.
Declared in ZIM.h

Parameters

NameTypeDescription
handlerstd::shared_ptr<ZIMEventHandler>Event notification callback. Developers should override callbacks to focus on specific notifications based on their own business scenarios.

Details

Supported version: 1.1.0 and above.

Detailed description: Set event notification callback, pass [null] to clear the set callback.

Calling timing: After calling [create] to create an instance, this function must be called through the instance.

If the developer calls this function multiple times, it will overwrite the callback set by the last call to this function.

Life cycle: Set this function after calling [create], and you can receive ZIM-related event notifications normally; after calling [destroy], you will no longer receive any event notifications.

login

login
deprecated
public void login(const ZIMUserInfo & userInfo, const std::string& token, ZIMLoggedInCallback callback)
Login, you must log in before using all functions.
Declared in ZIM.h

Parameters

NameTypeDescription
userInfoconst ZIMUserInfo &Unique ID used to identify the user. Note that the userID must be unique under the same appID, otherwise mutual kicks out will occur.
Note: Do not set ZIMUserInfo.userAvatarUrl through this interface.
tokenconst std::string&The token issued by the developer's business server, used to ensure security. The generation rules are detailed in ZEGO document website. The token validity period cannot exceed 24 days.
callbackZIMLoggedInCallback
  • Related callbacks: In addition to getting the login result in the callback parameter, the developer will also receive the [onConnectionStateChanged] callback during the login request and after the login is successful/failed to determine the current user's login status.

Related reference: For details, please refer to Authentication (https://docs.zegocloud.com/article/16357).

Deprecated
This API has been deprecated since 2.13.0. Please use the [login] API instead.

Return

Callback of login result.

login

login
deprecated
public void login(const ZIMUserInfo & userInfo, const std::string& callback)
Login, you must log in before using all functions.
Declared in ZIM.h

Parameters

NameTypeDescription
userInfoconst ZIMUserInfo &Unique ID used to identify the user. Note that the userID must be unique under the same appID, otherwise mutual kicks out will occur.
Note: Do not set ZIMUserInfo.userAvatarUrl through this interface.
callbackconst std::string&
  • Related callbacks: In addition to getting the login result in the callback parameter, the developer will also receive the [onConnectionStateChanged] callback during the login request and after the login is successful/failed to determine the current user's login status.
Deprecated
This API has been deprecated since 2.13.0. Please use the [login] API instead.

Return

Callback of login result.

login

login
public void login(const std::string& userID, const ZIMLoginConfig & config, ZIMLoggedInCallback callback)
Login, you must log in before using all functions.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDconst std::string&Used to identify user information, the unique ID of the user.
configconst ZIMLoginConfig &Various parameters used for specific login actions.
callbackZIMLoggedInCallback
  • Related callbacks: In addition to getting the login result in the callback parameter, the developer will also receive the [onConnectionStateChanged] callback during the login request and after the login is successful/failed to determine the current user's login status.

Related reference: For details, please refer to Authentication (https://docs.zegocloud.com/article/16357).

Return

Callback of login result.

renewToken

renewToken
public void renewToken(const std::string & token, ZIMTokenRenewedCallback callback)
Update the authentication token.
Declared in ZIM.h

Parameters

NameTypeDescription
tokenconst std::string &The token issued by the developer's business server, used to ensure security. The generation rules are detailed in ZEGO document website.
callbackZIMTokenRenewedCallbackCallback of the renewing token result.

Details

Update the authentication token so that the authentication token can be updated in time after it expires, so as to continue to use ZIM functions normally.

  • Use cases: When you need to create a multi-person chat scene, you can create and join a room by this API.
  • When to call: This function must be called through the instance after calling [create] to create the instance.
  • Caution: After the developer receives the [onTokenWillExpire] callback, the developer needs to request the authentication server to regenerate a token in time.
  • Available since: 1.1.0 or above.

Return

Callback of the renewing token result.

queryUsersInfo

queryUsersInfo
public void queryUsersInfo(const std::vector\<std::string> & userIDs, const ZIMUsersInfoQueryConfig & config, ZIMUsersInfoQueriedCallback callback)
Query user information.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsconst std::vector<std::string> &userID list.
configconst ZIMUsersInfoQueryConfig &Query user information configuration.
callbackZIMUsersInfoQueriedCallbackCallback for querying user information returns the query result.

Details

Through this interface, you can query and obtain the corresponding UserInfo by userID.

  • When to call /Trigger: It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks: [ZIMUsersInfoQueriedCallback].

Usage restrictions: No more than 10 userids can be queried by invoking the interface at a time. If the interface is invoked multiple times within 10 seconds, the total number of userids queried cannot exceed 10.

  • Available since: 2.3.0 or above.

Return

Callback of the query user result.

updateUserName

updateUserName
public void updateUserName(const std::string & userName, ZIMUserNameUpdatedCallback callback)
Update user's user name.
Declared in ZIM.h

Parameters

NameTypeDescription
userNameconst std::string &User name , It is customized by the developer. For version 2.0.0 and onwards, the string has a maximum length of 256 bytes.
callbackZIMUserNameUpdatedCallbackThe callback of the update user name.

Details

After user logs in, calling this interface could update the user's own user name.

  • When to call: After the user is logged in.

This interface does not support modifying user names in rooms.

  • Privacy reminder: Try not to pass in sensitive information involving personal privacy, including but not limited to mobile phone numbers, ID numbers, passport numbers, real names, etc.
  • Related callbacks: [ZIMUserNameUpdatedCallback].
  • Related APIs: [updateUserExtendedData] and [queryUsersInfo].
  • Available since: 2.2.0 or above.

Return

The result of the update user name.

updateUserAvatarUrl

updateUserAvatarUrl
public void updateUserAvatarUrl(const std::string & userAvatarUrl, ZIMUserAvatarUrlUpdatedCallback callback)
Update user's avatar URL.
Declared in ZIM.h

Parameters

NameTypeDescription
userAvatarUrlconst std::string &User avatar URL wanted to changed to .
callbackZIMUserAvatarUrlUpdatedCallbackCallback for user profile picture update.

Details

Supported versions: 2.3.0 and above.

Detail description: After the user logs in, calling this interface can set or update the user's own user avatar URL.

Call timing/notify timing: After the user logs in.

The user avatar itself needs to be stored by the developer, and ZIM only saves its user information as a pass-through URL.

Usage Restriction: There is no limit on special characters and a maximum of 500 bytes.

Related callback: [ZIMUserAvatarUrlUpdatedCallback].

Related interface: [queryUsersInfo].

Return

The result of the update user avatar URL.

updateUserExtendedData

updateUserExtendedData
public void updateUserExtendedData(const std::string & extendedData, ZIMUserExtendedDataUpdatedCallback callback)
Update user's user extended data.
Declared in ZIM.h

Parameters

NameTypeDescription
extendedDataconst std::string &User extended data wanted to changed to .
callbackZIMUserExtendedDataUpdatedCallbackThe callback of the update user extended data.

Details

After user logs in, calling this interface could update the user's own user extended data.

  • When to call: After the user is logged in.
  • Privacy reminder: Try not to pass in sensitive information involving personal privacy, including but not limited to mobile phone numbers, ID numbers, passport numbers, real names, etc.
  • Related callbacks: [ onUserNameUpdatedCallback ].
  • Related APIs: [updateUserName] and [ queryUsersInfo ].
  • Available since: 2.2.0 or above.

Return

The result of the update user extended data.

uploadLog

uploadLog
public void uploadLog(ZIMLogUploadedCallback callback)
Upload log and call after setting up log path.
Declared in ZIM.h

Parameters

NameTypeDescription
callbackZIMLogUploadedCallback
  • Related callbacks: Developers can get the upload results through the callback parameter.

Return

The result of the log upload.

logout

logout
public void logout()
Log out of ZIM service.
Declared in ZIM.h

Log out of the ZIM service.

  • Use cases: This function must be called from the instance after it has been created by calling [create].
  • When to call: After invoking [logout], you can no longer use ZIM's chat, room, send and receive, and other functions. To use the ZIM service again, the developer must call [login] to login again.
  • Caution: Upon logout, the developer will receive the [onConnectionStateChanged] callback with the login state being [Disconnected].
  • Available since: 1.1.0 or above.

destroy

destroy
public void destroy()
Destroy the ZIM instance.
Declared in ZIM.h

Supported version: 1.1.0 and above.

Detailed description: Release the resources used by the ZIM instance. This function must be called to release the occupied memory resources when ZIM is no longer needed, otherwise a memory leak may occur.

Call timing: call when ZIM is no longer needed, usually before emptying the ZIM object.

After calling this function, ZIM internal functions can no longer be used, and all callback notifications will no longer be triggered. If you need to continue using the ZIM function, please call [create] again to create a new instance.

callInvite

callInvite
public void callInvite(std::vector<std::string> invitees, const ZIMCallInviteConfig & config, ZIMCallInvitationSentCallback callback)
Initiate a call invitation.
Declared in ZIM.h

Parameters

NameTypeDescription
inviteesstd::vector<std::string>list of invitees.
configconst ZIMCallInviteConfig &Call Invitation Related Configuration.
callbackZIMCallInvitationSentCallbackCallback for initiating a call invitation.
  • When to call: It can be called after creating a ZIM instance through [create].

The call invitation has a timeout period, and the call invitation will end when the timeout period expires.

  • Related callbacks: [ZIMCallInvitationSentCallback].

Return

Callback of the call invite result.

callJoin

callJoin
public void callJoin(const std::string & callID, const ZIMCallJoin & config, ZIMCallJoinSentCallback callback)
Join an advanced mode call, or switch the main device for the advanced mode call (multi-terminal login only).
Declared in ZIM.h

Parameters

NameTypeDescription
callIDconst std::string &The advanced call ID which user wants to join.
configconst ZIMCallJoin &Related configuration for join call invitations.
callbackZIMCallJoinSentCallbackThe callback of the operation to join the call or switch to the main device.

Details

After create an advanced mode call invitation, you can invoke this interface to join the call or switch the primary device.

  • Use cases: Users who are not in the call join the call, and users who are already in the call switch to the primary device.
  • When to call: Need to be invoked after logged in.
  • Available since: 2.12.0.

Return

The callback of the operation to join the call or switch to the main device.

callCancel

callCancel
public void callCancel(std::vector<std::string> invitees, std::string callID, ZIMCallCancelConfig config, ZIMCallCancelSentCallback callback)
Cancel the call invitation.
Declared in ZIM.h

Parameters

NameTypeDescription
inviteesstd::vector<std::string>List of invitees.
callIDstd::stringThe ID of the call invitation to cancel.
configZIMCallCancelConfigCancel the related configuration of call invitation.
callbackZIMCallCancelSentCallbackCallback for canceling a call invitation.
  • When to call: It can be called after creating a ZIM instance through [create].

Canceling the call invitation after the timeout period of the call invitation expires will fail.

  • Related callbacks: [ZIMCallCancelSentCallback].

Return

Callback of the call cancel result.

callAccept

callAccept
public void callAccept(std::string callID, ZIMCallAcceptConfig config, ZIMCallAcceptanceSentCallback callback)
Accept the call invitation.
Declared in ZIM.h

Parameters

NameTypeDescription
callIDstd::stringThe call invitation ID to accept.
configZIMCallAcceptConfigConfiguration related to accepting call invitations.
callbackZIMCallAcceptanceSentCallbackCallback to accept call invitation.
  • When to call: It can be called after creating a ZIM instance through [create].

The callee will fail to accept an uninvited callid.

  • Related callbacks: [ZIMCallAcceptanceSentCallback].

Return

Callback of the call accept result.

callReject

callReject
public void callReject(std::string callID, ZIMCallRejectConfig config, ZIMCallRejectionSentCallback callback)
Reject the call invitation.
Declared in ZIM.h

Parameters

NameTypeDescription
callIDstd::stringThe ID of the call invitation to be rejected.
configZIMCallRejectConfigRelated configuration for rejecting call invitations.
callbackZIMCallRejectionSentCallbackCallback for rejecting call invitations.
  • When to call: It can be called after creating a ZIM instance through [create].

The callee will fail to reject the uninvited callid.

  • Related callbacks: [ZIMCallRejectionSentCallback].

Return

Callback of the call reject result.

callQuit

callQuit
public void callQuit(const std::string & callID, const ZIMCallQuitConfig & config, ZIMCallQuitSentCallback callback)
Reject the call invitation.
Declared in ZIM.h

Parameters

NameTypeDescription
callIDconst std::string &The ID of the call invitation to be quit.
configconst ZIMCallQuitConfig &Related configuration for quit call invitations.
callbackZIMCallQuitSentCallbackCallback for quit call invitations.
  • When to call: After the call is established, users whose call status is Accepted can call this interface.

The callee will fail to quit the uninvited callid.

  • Related callbacks: [ZIMCallQuitSentCallback].

Return

Callback of the call quit result.

callEnd

callEnd
public void callEnd(const std::string & callID, const ZIMCallEndConfig & config, ZIMCallEndSentCallback callback)
End the call invitation.
Declared in ZIM.h

Parameters

NameTypeDescription
callIDconst std::string &The ID of the call invitation to be ended.
configconst ZIMCallEndConfig &Related configuration for end call invitations.
callbackZIMCallEndSentCallbackCallback for end call invitations.
  • When to call: The call was in advanced mode and the user status was Accepted.

User calls that are not in the call will fail. ZIM SDK Does not have service logic after the call ends, and developers can customize the development logic after the end.

  • Related callbacks: [ZIMCallEndSentCallback].

Return

Callback of the call end result.

callingInvite

callingInvite
public void callingInvite(const std::vector\<std::string> & invitees, const std::string & callID, const ZIMCallingInviteConfig & config, ZIMCallingInvitationSentCallback callback)
Invite other users to join the call invitation
Declared in ZIM.h

Parameters

NameTypeDescription
inviteesconst std::vector<std::string> &List of invited user ids.
callIDconst std::string &callID of the current call in advanced mode.
configconst ZIMCallingInviteConfig &This section describes how to configure the call invitation.
callbackZIMCallingInvitationSentCallbackInvite the callback of the current call.
  • When to call: After calling [callInvite] to initiate a call invitation in advanced mode.

User calls that are not in the call will fail. ZIM SDK has no relevant business logic after accepting. Developers can customize the development logic after adding calls. By default, a call can contain a maximum of 9 users.

  • Related callbacks: [ZIMCallingInvitationSentCallback].

Return

Callback result of inviting the current call.

queryCallInvitationList

queryCallInvitationList
public void queryCallInvitationList(const ZIMCallInvitationQueryConfig & config, ZIMCallInvitationListQueriedCallback callback)
Query call invitation list
Declared in ZIM.h

Parameters

NameTypeDescription
configconst ZIMCallInvitationQueryConfig &Query the relevant configuration of the call invitation list.
callbackZIMCallInvitationListQueriedCallbackInquire the results of the call invitation list.
  • When to call: Run [create] to create a ZIM instance, which can be invoked after login.
  • Related callbacks: [ZIMCallInvitationListQueriedCallback].

Return

Inquire the results of the call invitation list.

createGroup

createGroup
public void createGroup(ZIMGroupInfo groupInfo, const std::vector<std::string> userIDs, ZIMGroupCreatedCallback callback)
Create groups.
Declared in ZIM.h

Parameters

NameTypeDescription
groupInfoZIMGroupInfoConfiguration information for the group to be created.
userIDsconst std::vector<std::string>List of users invited to the group.
callbackZIMGroupCreatedCallbackCallback for the result of creating a group.

Details

You can call this interface to create a group, and the person who calls this interface is the group leader. An empty string if the group name is left blank.

  • Use cases: You can use this interface to create a chat scenario and join a group.
  • When to call: After you create a ZIM instance with [create] and login with [login].
  • Impacts on other APIs: You can use [joinGroup] to join a group, [leaveGroup] to leave a group, or [dismissGroup] to dismiss a group.
  • Related callbacks: The result of creating the group is obtained through the [ZIMGroupCreatedCallback] callback.
  • Related APIs: Call [joinGroup] to join a group, call [leaveGroup] to leave a group, call [dismissGroup] to dismiss a group.
  • Available since: 2.0.0 and above.
  • Restrictions: Available after login, unavailable after logout. UserIDs support a maximum of 100 users .

searchLocalGroups

searchLocalGroups
virtual void searchLocalGroups(const ZIMGroupSearchConfig & config, ZIMGroupsSearchedCallback callback)
Search local groups.
Declared in ZIM.h

Parameters

NameTypeDescription
configconst ZIMGroupSearchConfig &Configuration for searching groups.
callbackZIMGroupsSearchedCallbackCallback of the search groups result.
  • Related callbacks: [ZIMGroupsSearchedCallback].
  • Restrictions: Takes effect after login, becomes invalid after logout.

Return

Callback of the search groups result.

searchLocalGroupMembers

searchLocalGroupMembers
virtual void searchLocalGroupMembers(const std::string & groupID, const ZIMGroupMemberSearchConfig & config, ZIMGroupMembersSearchedCallback callback)
Search local group members.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDconst std::string &Group ID of the joined group.
configconst ZIMGroupMemberSearchConfig &The configuration for searching group members.
callbackZIMGroupMembersSearchedCallbackCallback for the result of searching group members.
  • Related callbacks: [ZIMGroupMembersSearchedCallback].
  • Restrictions: Takes effect after login, becomes invalid after logout.

Return

Callback for the result of searching group members.

createGroup

createGroup
public void createGroup(ZIMGroupInfo groupInfo, const std::vector<std::string> userIDs, ZIMGroupAdvancedConfig config, ZIMGroupCreatedCallback callback)
Create a group with the andvanced info such as group attributes and group notice.
Declared in ZIM.h

Parameters

NameTypeDescription
groupInfoZIMGroupInfoConfiguration information for the group to be created.
userIDsconst std::vector<std::string>List of users invited to the group.
configZIMGroupAdvancedConfigCreate the relevant configuration of the group.
callbackZIMGroupCreatedCallbackCallback for the result of creating a group.

Details

You can call this interface to create a group, and the person who calls this interface is the group leader.

  • Use cases: You can use this interface to create a chat scenario and join a group.
  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Caution: Available after login, unavailable after logout. UserIDs can have a maximum of 100 users and a group can have a maximum of 500 users.
  • Related callbacks: The result of creating the group is obtained through the [ZIMGroupCreatedCallback] callback.
  • Related APIs: You can use [joinGroup] to join a group, [leaveGroup] to leave a group, or [dismissGroup] to dismiss a group.
  • Available since: 2.0.0 and above.

Return

Callback for the result of creating a group.

joinGroup

joinGroup
public void joinGroup(const std::string groupID, ZIMGroupJoinedCallback callback)
join a goup.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDconst std::stringThe group ID to join.
callbackZIMGroupJoinedCallbackCallback for the result of joining the group.

Details

When a group is created, other users can join the group through [joinGroup]. If the group does not exist, the joining fails.

  • Use cases: This interface is used to join a group in a chat scenario.
  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Caution: Available after login, unavailable after logout. If you have joined a group, the join succeeds.
  • Related callbacks: To get the result of joining the room, call [ZIMGroupJoinedCallback].
  • Related APIs: You can use [createGroup] to create a group, [leaveGroup] to leave a group, or [dismissGroup] to dismiss a group.
  • Available since: 2.0.0 and above.

Return

Callback for the result of joining the group.

leaveGroup

leaveGroup
public void leaveGroup(const std::string groupID, ZIMGroupLeftCallback callback)
Leave the group.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDconst std::stringThe group ID to leave.
callbackZIMGroupLeftCallbackCallback for the result of leaving the group.

Details

After a user joins a group, the user can leave the group through this interface.

  • Use cases: This interface is used to exit a chat group.
  • When to call /Trigger: It can be invoked after a ZIM instance is created through [create] and logged in.
  • Caution: When the group owner quits the group, the identity of the group owner will be automatically transferred to the earliest member who joined the group. When all members exit the group, the group is automatically dissolved.
  • Impacts on other APIs: You can use [createGroup] to create a group, [joinGroup] to join a group, or [dismissGroup] to dismiss a group.
  • Related callbacks: The result of leaving the room can be obtained by the [ZIMGroupLeftCallback] callback.
  • Available since: 2.0.0 and above.
  • Restrictions: Available after login, unavailable after logout.

Return

Callback for the result of leaving the group.

dismissGroup

dismissGroup
public void dismissGroup(const std::string groupID, ZIMGroupDismissedCallback callback)
Disband the group.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDconst std::stringThe ID of the group to be disbanded.
callbackZIMGroupDismissedCallbackCallback for the result of disbanding the group.

Details

When a group is created, you can use [dismissGroup] to dismiss it.

  • Use cases: After you create a chat group, you do not need to use this interface to dissolve the group.
  • When to call /Trigger: This parameter can be called after a group is created by using [createGroup].
  • Caution: A non-group owner cannot dissolve a group.
  • Related callbacks: Through callback can get [ZIMGroupDismissedCallback] dissolution results of the room, through [onGroupStateChanged] listen callback can get the room status.
  • Related APIs: You can use [createGroup] to create a group, [joinGroup] to join a group, and [leaveGroup] to leave a group.
  • Available since: 2.0.0 and above.

Return

Callback for the result of disbanding the group.

kickGroupMembers

kickGroupMembers
public void kickGroupMembers(const std::vector<std::string> userIDs, const std::string groupID, ZIMGroupMemberKickedCallback callback)
kick some members out of the group.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsconst std::vector<std::string>List of users who have been kicked out of the group.
groupIDconst std::stringThe group ID of the member who will be kicked out.
callbackZIMGroupMemberKickedCallbackCallback for the result of being kicked out of the group.

Details

After a user joins a group, you can use this method to remove the user from the group.

  • Use cases: You can use this method to remove one or more users from the group.
  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Caution: This interface does not require the peer's consent or the peer's online status. It cannot accept group-related callbacks after being kicked out. History messages and sessions remain after being kicked out and can still enter the group.
  • Related callbacks: Through the callback [ZIMGroupMemberKickedCallback] can get the user kicked out the results of the group.
  • Related APIs: You can invite a target user into a group through [inviteUsersIntoGroup].
  • Available since: 2.0.0 and above.
  • Restrictions: You can't kick someone unless you're the leader of the group.

Return

Callback for the result of being kicked out of the group.

inviteUsersIntoGroup

inviteUsersIntoGroup
public void inviteUsersIntoGroup(const std::vector<std::string> userIDs, const std::string groupID, ZIMGroupUsersInvitedCallback callback)
invite some members into the group.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsconst std::vector<std::string>List of users who have been invited to the group, the maximum number supported in a single operation is 100.
groupIDconst std::stringThe group ID of the member who will be invited to join.
callbackZIMGroupUsersInvitedCallbackCallback for the result of being invited to the group.

Details

When users need to be invited to join the group, they can be invited to the group by this method. If the group does not exist, the invitation will fail.

  • Use cases: You can use this method to invite one or more users to the group.
  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Caution: This interface does not require the peer's consent or the peer's online status.
  • Related callbacks: Through the callback [ZIMGroupUsersInvitedCallback] can get the user invited to the results of the group.
  • Related APIs: You can kick out a target user into a group through [kickGroupMembers].
  • Available since: 2.0.0 and above.
  • Restrictions: You can't invite someone unless you're the leader of the group.

Return

Callback for the result of being invited to the group.

transferGroupOwner

transferGroupOwner
public void transferGroupOwner(const std::string toUserID, const std::string groupID, ZIMGroupOwnerTransferredCallback callback)
Transfer the group owner.
Declared in ZIM.h

Parameters

NameTypeDescription
toUserIDconst std::stringThe converted group owner ID.
groupIDconst std::stringThe group ID of the group owner to be replaced.
callbackZIMGroupOwnerTransferredCallbackThe callback of the transfer group owner.

Details

After a group is created, the group owner can use this method to assign the group owner to a specified user.

  • Use cases: In a group chat scenario, you can transfer the group master through this interface.
  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Related callbacks: Through the callback [ZIMGroupOwnerTransferredCallback] can get the result of the transfer of the group manager.
  • Available since: 2.0.0 and above.
  • Restrictions: You cannot transfer a group owner if you are not a group owner.

Return

The callback of the transfer group owner.

updateGroupAlias

updateGroupAlias
public void updateGroupAlias(const std::string& groupAlias, const std::string & groupID, ZIMGroupAliasUpdatedCallback callback)
Update the group alias.
Declared in ZIM.h

Parameters

NameTypeDescription
groupAliasconst std::string&The new group alias. Maximum length is 256 bytes.
groupIDconst std::string &The group ID whose group alias will be updated.
callbackZIMGroupAliasUpdatedCallbackCallback for the result of updating the group alias.

Details

After a group is created, users can call this method to change the group alias.

  • Use cases: To distinguish different group.
  • When to call: The ZIM instance can be invoked after being created by [create] and logged in.
  • Related callbacks: Through the callback [ZIMGroupAliasUpdatedCallback] can get the result of the change of group alias.
  • Available since: 2.18.0 and above.

Return

The result of updating the group alias.

updateGroupName

updateGroupName
public void updateGroupName(const std::string& groupName, const std::string & groupID, ZIMGroupNameUpdatedCallback callback)
Update the group name.
Declared in ZIM.h

Parameters

NameTypeDescription
groupNameconst std::string&The group name that needs to be updated.
groupIDconst std::string &The group ID whose group name will be updated.
callbackZIMGroupNameUpdatedCallbackCallback for the result of updating the group name.

Details

After a group is created, users can call this method to change the group name.

  • Use cases: After creating a group, you need to change the group name.
  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Related callbacks: Through the callback [ZIMGroupNameUpdatedCallback] can get the result of the change of name, through [onGroupNoticeUpdated] can get update group name information.
  • Available since: 2.0.0 and above.
  • Restrictions: Group members and group owners can change the group name. The maximum length of the name is 100 bytes.

Return

Callback for the result of updating the group name.

muteGroup

muteGroup
public void muteGroup(bool isMute, std::string groupID, ZIMGroupMuteConfig config, ZIMGroupMutedCallback callback)
Mute a group
Declared in ZIM.h

Parameters

NameTypeDescription
isMuteboolIdentify the action as either muting the group or unmuting the group.
groupIDstd::stringThe group ID whose group mute info will be updated.
configZIMGroupMuteConfigConfiguration for group mute.
callbackZIMGroupMutedCallbackCallback for the result of updating the group mute info.

Details

Once a group is created, the group administrator can call this interface to implement group muting and unmuting.

  • Use cases: After creating a group, users need to change the mute status of the group.
  • When to call: This can be called after a ZIM instance is created using [create] and logged into the group.
  • Related callbacks: The result of changing the group mute status can be obtained through the [ZIMGroupMutedCallback] callback. The updated group mute status information can be obtained through [onGroupMuteInfoUpdated].
  • Available since: 2.14.0 and above.
  • Restrictions: This can be called by the group owner and group administrators.

Return

Callback for the result of updating the group mute info.

muteGroupMembers

muteGroupMembers
public void muteGroupMembers(bool isMute, const std::vector\<std::string> & userIDs, const std::string & groupID, ZIMGroupMemberMuteConfig config, ZIMGroupMembersMutedCallback callback)
Mute group members.
Declared in ZIM.h

Parameters

NameTypeDescription
isMuteboolIdentify the action as either muting the group members or unmuting the group members.
userIDsconst std::vector<std::string> &The group member ID that needs to change the mute status.
groupIDconst std::string &The group ID whose group members mute info will be updated.
configZIMGroupMemberMuteConfigConfiguration for group members mute.
callbackZIMGroupMembersMutedCallbackCallback for the result of updating the group members mute info.

Details

Once a group is created, the group administrator can call this interface to implement group members muting and unmuting.

  • Use cases: After creating a group, users need to change the mute status of the group members.
  • When to call: This can be called after a ZIM instance is created using [create] and logged into the group.
  • Related callbacks: The result of changing the group members mute status can be obtained through the [ZIMGroupMembersMutedCallback] callback. The updated group members mute status information can be obtained through [onGroupMemberInfoUpdated].
  • Available since: 2.14.0 and above.
  • Restrictions: This can be called by the group owner and group administrators.

Return

Callback for the result of updating the group members mute info.

updateGroupAvatarUrl

updateGroupAvatarUrl
public void updateGroupAvatarUrl(std::string groupAvatarUrl, std::string groupID, ZIMGroupAvatarUrlUpdatedCallback callback)
Update the group avatar URL.
Declared in ZIM.h

Parameters

NameTypeDescription
groupAvatarUrlstd::stringThe group avatar URL that needs to be updated.

Usage Restriction: There is no limit on special characters and a maximum of 500 bytes.
groupIDstd::stringThe group ID of the group avatar URL that will be updated.
callbackZIMGroupAvatarUrlUpdatedCallbackCallback for the result of updating the group avatar URL.
  • Related callbacks: The result of changing the group name can be obtained through the [ZIMGroupAvatarUrlUpdatedCallback] callback, and the updated group avatar information can be obtained through the [onGroupAvatarUrlUpdated] callback.

Return

Callback for the result of updating the group avatar URL.

updateGroupNotice

updateGroupNotice
public void updateGroupNotice(const std::string groupNotice, const std::string groupID, ZIMGroupNoticeUpdatedCallback callback)
Update group announcements.
Declared in ZIM.h

Parameters

NameTypeDescription
groupNoticeconst std::stringPre-updated group announcements.
groupIDconst std::stringThe group ID of the group announcement that will be updated.
callbackZIMGroupNoticeUpdatedCallbackCallback to update the results of group announcements.

Details

When a group is created, users can use this method to update the group bulletin.

  • Use cases: You need to update the group bulletin in the group.
  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Related callbacks: Through callback [ZIMGroupNoticeUpdateCallback] can get update group of the results announcement, announcement by [onGroupNoticeUpdated] can get update group information.
  • Available since: 2.0.0 and above.
  • Restrictions: Only group members can update the group bulletin. The maximum number of bytes is 300. There is no special character limit.

Return

Callback to update the results of group announcements.

updateGroupJoinMode

updateGroupJoinMode
public void updateGroupJoinMode(ZIMGroupJoinMode mode, std::string groupID, ZIMGroupJoinModeUpdatedCallback callback)
Update group verification mode.
Declared in ZIM.h

Parameters

NameTypeDescription
modeZIMGroupJoinModeGroup verification mode.
groupIDstd::stringThe group ID.
callbackZIMGroupJoinModeUpdatedCallbackCallback for the result of the update operation.

Details

When a group is created, the group owner and administrators can use this method to update the group verification mode.

  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Available since: 2.15.0 and above.

Return

Callback for the result of the update operation.

updateGroupInviteMode

updateGroupInviteMode
public void updateGroupInviteMode(ZIMGroupInviteMode mode, std::string groupID, ZIMGroupInviteModeUpdatedCallback callback)
Update group verification mode.
Declared in ZIM.h

Parameters

NameTypeDescription
modeZIMGroupInviteModeGroup verification mode.
groupIDstd::stringThe group ID.
callbackZIMGroupInviteModeUpdatedCallbackCallback for the result of the update operation.

Details

When a group is created, the group owner and administrators can use this method to update the group verification mode.

  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Available since: 2.15.0 and above.

Return

Callback for the result of the update operation.

acceptGroupInviteApplication

acceptGroupInviteApplication
public void acceptGroupInviteApplication(std::string inviterUserID, std::string groupID, ZIMGroupInviteApplicationAcceptConfig config, ZIMGroupInviteApplicationAcceptedCallback callback)
Accept an application to invite to the group.
Declared in ZIM.h

Parameters

NameTypeDescription
inviterUserIDstd::stringInviter user ID.
groupIDstd::stringThe group ID.
configZIMGroupInviteApplicationAcceptConfigAgree to the configuration of the application to invite the group.
callbackZIMGroupInviteApplicationAcceptedCallbackCallback for the result of the operation.

Details

When a group's beInviteMode mode is Auth, users outside the group can accept the invitation through this method and become group members after receiving the group invitation.

  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Available since: 2.15.0 and above.

Return

Callback for the result of the operation.

acceptGroupJoinApplication

acceptGroupJoinApplication
public void acceptGroupJoinApplication(std::string userID, std::string groupID, ZIMGroupJoinApplicationAcceptConfig config, ZIMGroupJoinApplicationAcceptedCallback callback)
Accept an application to join the group.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDstd::stringApplicant user ID.
groupIDstd::stringThe group ID.
configZIMGroupJoinApplicationAcceptConfigAgree to the configuration of the application to join the group.
callbackZIMGroupJoinApplicationAcceptedCallbackCallback for the result of the operation.

Details

When a group's joinMode requires Auth, after an external user sends a group application, the group owner or administrator can agree to the application through this method.

  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Available since: 2.15.0 and above.

Return

Callback for the result of the operation.

queryGroupApplicationList

queryGroupApplicationList
public void queryGroupApplicationList(ZIMGroupApplicationListQueryConfig config, ZIMGroupApplicationListQueriedCallback callback)
Query the group application list.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMGroupApplicationListQueryConfigQuery the configuration of the application list.
callbackZIMGroupApplicationListQueriedCallbackCallback for the result of the operation.

Details

The query results include your own application to join the group and your application to be invited to join the group. When the user is a group owner or administrator, the query results will also include other people's applications to join the group and their own applications to invite others to the group.

  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Available since: 2.15.0 and above.

Return

Callback for the result of the operation.

rejectGroupInviteApplication

rejectGroupInviteApplication
public void rejectGroupInviteApplication(std::string inviterUserID, std::string groupID, ZIMGroupInviteApplicationRejectConfig config, ZIMGroupInviteApplicationRejectedCallback callback)
Reject an application to invite to the group.
Declared in ZIM.h

Parameters

NameTypeDescription
inviterUserIDstd::stringInviter user ID.
groupIDstd::stringThe group ID.
configZIMGroupInviteApplicationRejectConfigReject to the configuration of the application to invite the group.
callbackZIMGroupInviteApplicationRejectedCallbackCallback for the result of the operation.

Details

When a group's beInviteMode requires Auth, users invited to the group can reject the invitation through this method.

  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Available since: 2.15.0 and above.

Return

Callback for the result of the operation.

rejectGroupJoinApplication

rejectGroupJoinApplication
public void rejectGroupJoinApplication(std::string userID, std::string groupID, ZIMGroupJoinApplicationRejectConfig config, ZIMGroupJoinApplicationRejectedCallback callback)
Reject an application to join the group.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDstd::stringApplicant user ID.
groupIDstd::stringThe group ID.
configZIMGroupJoinApplicationRejectConfigReject to the configuration of the application to join the group.
callbackZIMGroupJoinApplicationRejectedCallbackCallback for the result of the operation.

Details

When a group's joinMode is Auth, the group owner or administrator can reject to the user's application to join the group through this method.

  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Available since: 2.15.0 and above.

Return

Callback for the result of the operation.

sendGroupInviteApplications

sendGroupInviteApplications
public void sendGroupInviteApplications(std::vector\<std::string> userIDs, std::string groupID, ZIMGroupInviteApplicationSendConfig config, ZIMGroupInviteApplicationsSentCallback callback)
Send an application to invite the group.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsstd::vector<std::string>List of invited users, the maximum number supported in a single operation is 20.
groupIDstd::stringThe group ID.
configZIMGroupInviteApplicationSendConfigInvite to the group to apply for configuration.
callbackZIMGroupInviteApplicationsSentCallbackCallback for the result of the operation.

Details

When a group's invitation verification mode requires approval by the invitee, group members can send invitations to the group through this method.

  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Available since: 2.15.0 and above.

Return

Callback for the result of the operation.

sendGroupJoinApplication

sendGroupJoinApplication
public void sendGroupJoinApplication(std::string groupID, ZIMGroupJoinApplicationSendConfig config, ZIMGroupJoinApplicationSentCallback callback)
Send an application to join the group.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDstd::stringThe group ID.
configZIMGroupJoinApplicationSendConfigJoin the group to apply for configuration.
callbackZIMGroupJoinApplicationSentCallbackCallback for the result of the operation.

Details

When a group's joinMode is Auth, users can apply to join the group through this method.

  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Available since: 2.15.0 and above.

Return

Callback for the result of the operation.

updateGroupBeInviteMode

updateGroupBeInviteMode
public void updateGroupBeInviteMode(ZIMGroupBeInviteMode mode, std::string groupID, ZIMGroupBeInviteModeUpdatedCallback callback)
Update group verification mode.
Declared in ZIM.h

Parameters

NameTypeDescription
modeZIMGroupBeInviteModeGroup verification mode.
groupIDstd::stringThe group ID.
callbackZIMGroupBeInviteModeUpdatedCallbackCallback for the result of the update operation.

Details

After a group is created, the group owner and administrators can update the invited group verification mode through this method.

  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Available since: 2.15.0 and above.

Return

Callback for the result of the update operation.

queryGroupInfo

queryGroupInfo
public void queryGroupInfo(const std::string groupID, ZIMGroupInfoQueriedCallback callback)
Query group information.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDconst std::stringThe group ID of the group information to be queried.
callbackZIMGroupInfoQueriedCallbackCallback for the result of querying group information.

Details

Query information about a created group.

  • Use cases: You need to obtain group information for display.
  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Related callbacks: Through the callback [ZIMGroupInfoQueriedCallback] can query the result of the group information.
  • Available since: 2.0.0 and above.
  • Restrictions: Available after login, unavailable after logout.

Return

Callback for the result of querying group information.

queryGroupList

queryGroupList
public void queryGroupList(ZIMGroupListQueriedCallback callback)
Query group list.
Declared in ZIM.h

Parameters

NameTypeDescription
callbackZIMGroupListQueriedCallbackCallback for querying the result of the group list.

Details

Query the list of all groups.

  • Use cases: You need to get a list of groups to display.
  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Related callbacks: Through the callback [ZIMGroupListQueriedCallback] can get a check list of all current group results.
  • Available since: 2.0.0 and above.
  • Restrictions: Available after login, unavailable after logout.

Return

Callback for querying the result of the group list.

setGroupAttributes

setGroupAttributes
public void setGroupAttributes(std::unordered_map<std::string, std::string> groupAttributes, std::string groupID, ZIMGroupAttributesOperatedCallback callback)
Add or update group attributes.
Declared in ZIM.h

Parameters

NameTypeDescription
groupAttributesstd::unordered_map<std::string, std::string>group attributes.
groupIDstd::stringgroupID.
callbackZIMGroupAttributesOperatedCallbackCallback for setting group attributes.

Details

If a group already exists, all users of the group can use this method to set group attributes.

  • Use cases: Added extended field information about group description, such as group family, label, and industry category.
  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Related callbacks: Through the callback [ZIMGroupAttributesOperatedCallback] can get the result of the set of attributes.
  • Related APIs: [deleteGroupAttributes] can be used to deleteGroupAttributes, [queryGroupAttributes] can be used to queryGroupAttributes, [queryAllGroupAttributes] can be used to queryAllGroupAttributes.
  • Available since: 2.0.0 and above.
  • Restrictions: Only group members can set group attributes.

Return

Callback for setting group attributes.

deleteGroupAttributes

deleteGroupAttributes
public void deleteGroupAttributes(std::vector<std::string> keys, const std::string groupID, ZIMGroupAttributesOperatedCallback callback)
Delete group attribute.
Declared in ZIM.h

Parameters

NameTypeDescription
keysstd::vector<std::string>The key of the group attribute to delete.
groupIDconst std::stringThe group ID of the group attribute to be deleted.
callbackZIMGroupAttributesOperatedCallbackCallback for the result of removing the group attributes.

Details

When a group already exists, you can use this method to delete group attributes. Both the master and members of the interface group can be invoked.

  • Use cases: Deleted the extended field of the group description.
  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Related callbacks: Through the callback [ZIMGroupAttributesOperatedCallback] can delete the result of the group of attributes.
  • Related APIs: You can use [setGroupAttributes] to setGroupAttributes, [queryGroupAttributes] to queryGroupAttributes, and [queryAllGroupAttributes] to queryAllGroupAttributes.
  • Available since: 2.0.0 and above.
  • Restrictions: Only group members can delete group attributes.

Return

Callback for the result of removing the group attributes.

queryGroupAttributes

queryGroupAttributes
public void queryGroupAttributes(std::vector<std::string> keys, const std::string groupID, ZIMGroupAttributesQueriedCallback callback)
Query group attributes by keys.
Declared in ZIM.h

Parameters

NameTypeDescription
keysstd::vector<std::string>The key of the group attribute to be queried.
groupIDconst std::stringThe group ID of the group attribute to be queried.
callbackZIMGroupAttributesQueriedCallbackCallback for the result of querying group attributes.

Details

After a group is created, you can use this method to query the specified group attributes.

  • Use cases: You need to query the scenarios to display the specified group attributes.
  • When to call /Trigger: After creating a ZIM instance with [create] and logging in with [login].
  • Related callbacks: Through the callback [ZIMGroupAttributesQuriedCallback] can get query attributes of the specified group of results.
  • Related APIs: [queryAllGroupAttributes] Queries all group attributes.
  • Available since: 2.0.0 and above.
  • Restrictions: Available after login, unavailable after logout.

Return

Callback for the result of querying group attributes.

queryGroupAllAttributes

queryGroupAllAttributes
public void queryGroupAllAttributes(const std::string groupID, ZIMGroupAttributesQueriedCallback callback)
Query all attributes of the group.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDconst std::stringThe group ID of all group attributes to be queried.
callbackZIMGroupAttributesQueriedCallbackCallback for querying the result of all attributes of the group.

Details

After a group is created, you can use this method to query all group attributes.

  • Use cases: Scenarios where all group attributes need to be queried.
  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Related callbacks: Through callback can get query [ZIMGroupAttributesQuriedCallback] all the results of the group of attributes.
  • Related APIs: [queryGroupAttributes] Queries the attributes of the specified group.
  • Available since: 2.0.0 and above.

Return

Callback for querying the result of all attributes of the group.

setGroupMemberRole

setGroupMemberRole
public void setGroupMemberRole(int role, std::string forUserID, const std::string & groupID, ZIMGroupMemberRoleUpdatedCallback callback)
Set the group member role.
Declared in ZIM.h

Parameters

NameTypeDescription
roleintSet of group roles。
- 2: Administrator.
- 3: Ordinary members.
- Other values: The group role can be customized, and the permissions are the same as those of ordinary members. It is recommended that the value be greater than 100.
forUserIDstd::stringUser ID for which group role is set.
groupIDconst std::string &The group ID of the group role to be set.
callbackZIMGroupMemberRoleUpdatedCallbackCallback to set the result of the group member role.

Details

After a group is created, you can use this method to set the roles of group members.

  • Use cases: The ZIM instance can be invoked after being created by [create] and logged in.
  • When to call /Trigger: If the primary role of a group is 1 and the default role of other members is 3, you can invoke this interface to change the role.
  • Caution: The role of the group owner is 1, the role of the administrator is 2, and the role of the normal member is 3. You can modify it by calling this interface, but the role cannot be changed to 1. If you need to customize the role, it is recommended to set the value to 100 or higher, and its permissions will be the same as those of normal members.
  • Related callbacks: Through the callback [ZIMGroupMemberRoleUpdatedCallback] can be set up to get the results of the group of members of the role.
  • Available since: 2.0.0 and above.
  • Restrictions: Non-group master unavailable.

Return

Callback to set the result of the group member role.

setGroupMemberNickname

setGroupMemberNickname
public void setGroupMemberNickname(const std::string & nickname, const std::string & forUserID, const std::string& groupID, ZIMGroupMemberNicknameUpdatedCallback callback)
Set group member nickname.
Declared in ZIM.h

Parameters

NameTypeDescription
nicknameconst std::string &Set member nickname.
forUserIDconst std::string &User ID for which group nickname is set.
groupIDconst std::string&The group ID of the group member's nickname is set.
callbackZIMGroupMemberNicknameUpdatedCallbackCallback for the result of setting the group member's nickname.

Details

After a group is created, you can use this method to set nicknames for group members.

  • Use cases: Nicknames need to be set for group members.
  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Caution: A group member nickname can contain a maximum of 100 characters.
  • Related callbacks: Through the callback [ZIMGroupMemberNicknameUpdatedCallback] can be set up to get the results of the group members nickname.
  • Available since: 2.0.0 and above.
  • Restrictions: Available after login, unavailable after logout. The owner of a group can change his or her own nickname, while the members can change only their own nickname.

Return

Callback for the result of setting the group member's nickname.

queryGroupMemberInfo

queryGroupMemberInfo
public void queryGroupMemberInfo(const std::string userID, const std::string groupID, ZIMGroupMemberInfoQueriedCallback callback)
Query group member information.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDconst std::stringUser ID of the queried member information.
groupIDconst std::stringThe ID of the group whose member information will be queried.
callbackZIMGroupMemberInfoQueriedCallbackCallback for the result of querying group member information.

Details

After a group is created, you can use this method to query information about a specified group member.

  • Use cases: You need to obtain the specified group member information for display or interaction.
  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Related callbacks: Through the callback [ZIMGroupMemberInfoQueriedCallback] can get the query specifies the result of group membership information.
  • Available since: 2.0.0 and above.
  • Restrictions: Available after login, unavailable after logout.

Return

Callback for the result of querying group member information.

queryGroupMemberList

queryGroupMemberList
public void queryGroupMemberList(const std::string& groupID, ZIMGroupMemberQueryConfig config, ZIMGroupMemberListQueriedCallback callback)
Query the list of group members.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDconst std::string&The group ID of the group member list to be queried.
configZIMGroupMemberQueryConfigGroup member query configuration.
callbackZIMGroupMemberListQueriedCallbackCallback for querying the list of group members.

Details

After a group is created, you can use this method to query the group member list.

  • Use cases: You need to obtain the specified group member list for display or interaction.
  • When to call /Trigger: The ZIM instance can be invoked after being created by [create] and logged in.
  • Related callbacks: Through the callback [ZIMGroupMemberListQueriedCallback] can query the result of the group member list.
  • Available since: 2.0.0 and above.
  • Restrictions: Available after login, unavailable after logout.

Return

Callback for querying the list of group members.

queryGroupMemberMutedList

queryGroupMemberMutedList
public void queryGroupMemberMutedList(const std::string& groupID, ZIMGroupMemberMutedListQueryConfig config, ZIMGroupMemberMutedListQueriedCallback callback)
Query the list of group muted members.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDconst std::string&The group ID of the group muted member list to be queried.
configZIMGroupMemberMutedListQueryConfigGroup muted member query configuration.
callbackZIMGroupMemberMutedListQueriedCallbackCallback for querying the list of group muted members.

Details

After a group is created, you can use this method to query the group muted member list.

  • Use cases: You need to obtain the specified group muted member list for display or interaction.
  • When to call: The ZIM instance can be invoked after being created by [create] and logged in.
  • Related callbacks: Through the callback [ZIMGroupMembersMutedCallback] can query the result of the group muted member list.
  • Available since: 2.14.0 and above.
  • Restrictions: Available after login, unavailable after logout.

Return

Result for querying the list of group muted members.

queryGroupMemberCount

queryGroupMemberCount
public void queryGroupMemberCount(const std::string & groupID, ZIMGroupMemberCountQueriedCallback callback)
Query the number of group members in a specified group.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDconst std::string &The group ID of the group to be queried.
callbackZIMGroupMemberCountQueriedCallbackCallback for querying the number of groups.

Details

Query the number of group members in a group.

  • When to call: The ZIM instance can be invoked after being created by [create] and logged in.
  • Related callbacks: [ZIMGroupMemberCountQueriedCallback].
  • Available since: 2.2.0 or above.
  • Restrictions: This function can only query the group that the user has entered.

Return

Callback for querying the number of groups.

queryConversation

queryConversation
public void queryConversation(const std::string& conversationID, ZIMConversationType conversationType, ZIMConversationQueriedCallback callback)
Query a conversation by conversation ID and conversation type.
Declared in ZIM.h

Parameters

NameTypeDescription
conversationIDconst std::string&Conversation ID.
conversationTypeZIMConversationTypeConversation type.
callbackZIMConversationQueriedCallbackCallback for conversation query.

Details

This method displays the session list of the logged in user.

  • Use cases: When you need to know the relevant information of the specified conversation, you can call this interface to obtain the data source.
  • When to call /Trigger: Can be invoked after login.
  • Related callbacks: [ZIMConversationQueriedCallback].
  • Available since: 2.8.0 and above.
  • Restrictions: There is no limit to the frequency of use, available after login, unavailable after logout.

Return

Callback of the query conversation result.

queryConversationList

queryConversationList
public void queryConversationList(ZIMConversationQueryConfig config, ZIMConversationListQueriedCallback callback)
Query the conversation list.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMConversationQueryConfigConfiguration for session queries.
callbackZIMConversationListQueriedCallbackCallback for session query.

Details

This method displays the session list of the logged in user.

  • Use cases: This interface can be invoked to get the data source when you need to display an existing message session after logging in.
  • When to call /Trigger: Can be invoked after login.
  • Caution: NextConversation is the riveting point of the query message, which can be null for the first query. In subsequent query, the earliest conversation can be used as nextConversation to query earlier sessions. In paging query, Count in [ZIMConversationQueryConfig] fill each pull the number of sessions.
  • Related callbacks: [ZIMConversationListQueriedCallback].
  • Related APIs: [deleteConversation] Deletes the session. [clearConversationUnreadMessageCount] clear session readings.
  • Available since: 2.0.0 and above.
  • Restrictions: There is no limit to the frequency of use, available after login, unavailable after logout.

Return

Callback of the query conversation list result.

queryConversationList

queryConversationList
public void queryConversationList(ZIMConversationQueryConfig config, ZIMConversationFilterOption option, ZIMConversationListQueriedCallback callback)
Query the conversation list by filter options.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMConversationQueryConfigConfiguration for session queries.
optionZIMConversationFilterOptionFilter options for conversation list query.
callbackZIMConversationListQueriedCallbackCallback for conversation queried.

Details

This method allows you to query the conversation list of the logged-in user based on filter criteria.

  • Use cases: This interface can be invoked to get the data source when you need to display an existing message conversation after logging in.
  • When to call /Trigger: Can be invoked after login.
  • Caution: NextConversation is the riveting point of the query message, which can be null for the first query. In subsequent query, the earliest conversation can be used as nextConversation to query earlier sessions. In paging query, Count in [ZIMConversationQueryConfig] fill each pull the number of sessions.
  • Related callbacks: [ZIMConversationListQueriedCallback].
  • Available since: 2.17.0 and above.
  • Restrictions: There is no limit to the frequency of use, available after login, unavailable after logout.

Return

Callback of the query conversation list result.

queryConversationPinnedList

queryConversationPinnedList
public void queryConversationPinnedList(const ZIMConversationQueryConfig & config, ZIMConversationPinnedListQueriedCallback callback)
Query the conversation pinned list.
Declared in ZIM.h

Parameters

NameTypeDescription
configconst ZIMConversationQueryConfig &Configuration for session queries.
callbackZIMConversationPinnedListQueriedCallbackCallback for conversation pinned list query.

Details

This method displays the pinned conversation list of the logged in user.

  • Use cases: This interface can be invoked to get the data source when you need to display an existing pinned message conversation after logging in.
  • When to call /Trigger: Can be invoked after login.
  • Caution: NextConversation is the riveting point of the query message, which can be null for the first query. In subsequent query, the earliest conversation can be used as nextConversation to query earlier sessions. In paging query, Count in [ZIMConversationQueryConfig] fill each pull the number of sessions.
  • Available since: 2.8.0 and above.
  • Restrictions: There is no limit to the frequency of use, available after login, unavailable after logout.

queryConversationTotalUnreadMessageCount

queryConversationTotalUnreadMessageCount
public void queryConversationTotalUnreadMessageCount(ZIMConversationTotalUnreadMessageCountQueryConfig config, ZIMConversationTotalUnreadMessageCountQueriedCallback callback)
Query the conversations total unread message count by config.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMConversationTotalUnreadMessageCountQueryConfigConfiguration for conversation total unread message count queries.
callbackZIMConversationTotalUnreadMessageCountQueriedCallbackCallback for conversation total unread message count queried.

Details

his method can query the total number of unread messages in the conversations of the logged-in user according to the configuration items.

  • Use cases: This interface can be invoked to get the data source when you need to display an existing message conversation after logging in.
  • When to call /Trigger: Can be called after logging in.
  • Related callbacks: [ZIMConversationTotalUnreadMessageCountQueriedCallback].
  • Available since: 2.17.0 and above.
  • Restrictions: There is no limit on the frequency of use; it is available after logging in and not available after logging out.

Return

Callback for conversation total unread message count queried.

updateConversationPinnedState

updateConversationPinnedState
public void updateConversationPinnedState(bool isPinned, const std::string & conversationID, ZIMConversationType conversationType, ZIMConversationPinnedStateUpdatedCallback callback)
Modify the conversation pinned state.
Declared in ZIM.h

Parameters

NameTypeDescription
isPinnedboolWhether the conversation is pinned, true is pinned, false is unpinned.
conversationIDconst std::string &Conversation ID.
conversationTypeZIMConversationTypeConversation type.
callbackZIMConversationPinnedStateUpdatedCallbackCallback for updating the pinned state of the conversation.

Details

This method can modify the pinned state of the specified conversation of the logged-in user.

  • Use cases: You can call this interface when you need to modify the pinned state of a conversation.
  • When to call /Trigger: Can be invoked after login.
  • Related callbacks: [ZIMConversationPinnedStateUpdatedCallback].
  • Available since: 2.8.0 and above.
  • Restrictions: Available after login, unavailable after logout.

deleteAllConversations

deleteAllConversations
public void deleteAllConversations(ZIMConversationDeleteConfig config, ZIMConversationsAllDeletedCallback callback)
delete all conversations.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMConversationDeleteConfigdelete all conversation's configuration.
callbackZIMConversationsAllDeletedCallbackCallback to delete all conversations.

Details

This interface is invoked when all conversations needs to be deleted. All members in conversations can invoke this interface.

  • Use cases: If you want to delete all conversations when they are no longer needed, you can call this interface implementation.
  • When to call /Trigger: his parameter is invoked when conversations needs to be deleted and can be invoked after a ZIM instance is created. The call takes effect after login and becomes invalid after logout.
  • Impacts on other APIs: If deleted conversations include unread message will trigger the [onConversationTotalUnreadMessageCountUpdated] callback, the call is successful at login, and the other end will trigger [onConversationsAllDeleted] callback.
  • Related callbacks: [ZIMConversationsAllDeletedCallback]
  • Available since: 2.12.0 and above.

Return

Callback of delete conversations result.

deleteConversation

deleteConversation
public void deleteConversation(const std::string& conversationID, ZIMConversationType conversationType, ZIMConversationDeleteConfig config, ZIMConversationDeletedCallback callback)
delete the conversation.
Declared in ZIM.h

Parameters

NameTypeDescription
conversationIDconst std::string&conversationID.
conversationTypeZIMConversationTypeconversationtype.
configZIMConversationDeleteConfigdelete the session's configuration.
callbackZIMConversationDeletedCallbackCallback to delete session.

Details

This interface is invoked when a session needs to be deleted. All members in the session can invoke this interface.

  • Use cases: You can invoke this interface implementation to delete an entire session when it is no longer needed.
  • When to call /Trigger: his parameter is invoked when a session needs to be deleted and can be invoked after a ZIM instance is created. The call takes effect after login and becomes invalid after logout.
  • Impacts on other APIs: A successful call triggers the deleteConversation callback. If the deleted conversation contains unread messages, the [onConversationTotalUnreadMessageCountUpdated] callback is triggered.
  • Related callbacks: [ZIMConversationDeletedCallback]
  • Available since: 2.0.0 and above.

Return

Callback of the delete conversation result.

setConversationDraft

setConversationDraft
public void setConversationDraft(std::string draft, const std::string& conversationID, ZIMConversationType conversationType, ZIMConversationDraftSetCallback callback)
Set a conversation draft.
Declared in ZIM.h

Parameters

NameTypeDescription
draftstd::stringText message draft.
conversationIDconst std::string&conversationID.
conversationTypeZIMConversationTypeConversation type. Only Support peer and group conversations
callbackZIMConversationDraftSetCallbackCallback to set session draft.

Details

When you need to set a draft for a session, call this interface, and members of the session can call this interface.

  • Use cases: This interface can be invoked when you need to temporarily save the text message that the user is editing but has not yet sent.
  • When to call /Trigger: Call when you need to set session draft, call after creating ZIM instance, take effect after login, invalid after logout.
  • Impacts on other APIs: A successful call triggers the [onConversationchanged] callback.
  • Related callbacks: [ZIMConversationDraftSetCallback]
  • Available since: 2.14.0 and above.

Return

Callback to set session draft.

clearConversationTotalUnreadMessageCount

clearConversationTotalUnreadMessageCount
public void clearConversationTotalUnreadMessageCount(ZIMConversationTotalUnreadMessageCountClearedCallback callback)
clear all conversations unreads.
Declared in ZIM.h

Parameters

NameTypeDescription
callbackZIMConversationTotalUnreadMessageCountClearedCallbackCallback to remove all conversation unreads.

Details

Used to clear unread for all conversations.

  • Use cases: You can call this interface when you need to clear all unread conversations to zero.
  • When to call /Trigger: Called when all conversation readings need to be cleared.
  • Impacts on other APIs: Calling this method will trigger a total readings not updated callback [onConversationTotalUnreadMessageCountUpdated].
  • Related callbacks: [ZIMConversationTotalUnreadMessageCountClearedCallback].
  • Related APIs: [onConversationTotalUnreadMessageCountUpdated].
  • Available since: 2.12.0 and above.
  • Restrictions: Valid after login, invalid after logout.

Return

Callback to remove all conversation unreads result.

clearConversationUnreadMessageCount

clearConversationUnreadMessageCount
public void clearConversationUnreadMessageCount(const std::string& conversationID, ZIMConversationType conversationType, ZIMConversationUnreadMessageCountClearedCallback callback)
clear session unreads.
Declared in ZIM.h

Parameters

NameTypeDescription
conversationIDconst std::string&conversationID.
conversationTypeZIMConversationTypeconversation type.
callbackZIMConversationUnreadMessageCountClearedCallbackCallback to remove session unreads.

Details

Used to clear unread for the current user target session.

  • Use cases: This interface is called when a chat page is entered from a session and the original message readings of the session need to be cleared.
  • When to call /Trigger: Called when a target needs to be cleared without readings.
  • Impacts on other APIs: Calling this method will trigger a total readings not updated callback [conversationTotalUnreadMessageCountUpdated], would trigger a session to update callbacks [conversationChanged].
  • Related callbacks: [ZIMConversationUnreadMessageCountClearedCallback].
  • Related APIs: [conversationTotalUnreadMessageCountUpdated]、[conversationChanged].
  • Available since: 2.0.0 and above.
  • Restrictions: Valid after login, invalid after logout.

Return

Callback of the clear conversation unread message count result.

setConversationMark

setConversationMark
public void setConversationMark(int markType, bool enable, const std::vector<ZIMConversationBaseInfo> & conversationInfos, ZIMConversationMarkSetCallback callback)
Set or unset conversation marks.
Declared in ZIM.h

Parameters

NameTypeDescription
markTypeintMark type. The value range is [1, 20].
enableboolTrue is used to set a flag, while false is used to unset a flag.
conversationInfosconst std::vector<ZIMConversationBaseInfo> &List of brief information of conversations that need to be modified conversation tags. Up to 100 conversations can be passed in.
callbackZIMConversationMarkSetCallbackCallback for setting conversation mark.

Details

This method can set marks for the conversation.

  • Use cases: When you need to implement custom business logic based on conversation marks.
  • Default value: The conversation marks defaults to empty.
  • When to call: When logged in and a valid conversation exists, if you want to set or unset mark for the target conversation, call this interface.
  • Related callbacks: [ZIMConversationMarkSetCallback]。
  • Available since: 2.17.0 and above.
  • Restrictions: The range for setting marks is [1, 20]. A maximum of 100 conversations are supported for marking at one time.

Return

Callback for setting conversation mark.

setConversationNotificationStatus

setConversationNotificationStatus
public void setConversationNotificationStatus(ZIMConversationNotificationStatus status, const std::string& conversationID, ZIMConversationType conversationType, ZIMConversationNotificationStatusSetCallback callback)
Set the conversation notification state.
Declared in ZIM.h

Parameters

NameTypeDescription
statusZIMConversationNotificationStatusthe session notification state.
conversationIDconst std::string&Conversation ID. Currently, only "group" conversations and "peer"(only for 2.14.0 or above version) conversations can be set by notification state.
For group conversations, the conversation ID is the group ID.
For single chat conversations, the conversation ID is the user ID of the other party.
conversationTypeZIMConversationTypeconversation type. Currently, only "group" conversations and "peer"(only for 2.14.0 or above version) conversations can be set by notification state.
callbackZIMConversationNotificationStatusSetCallbackCallback for setting session notification status.

Details

This method enables DND by selecting whether the unread of the target session is updated when a message is received.

  • Use cases: If the user selects MESSAGE DO not Disturb (DND), the user can call the corresponding method.
  • Default value: Message DND is disabled by default.
  • When to call /Trigger: If the target session exists after login, invoke this interface if you want to enable the DND status of the target session.
  • Impacts on other APIs: After the DND state is enabled, receiving messages is not triggered [onConversationTotalUnreadMessageCountUpdated]。
  • Related callbacks: [ZIMConversationNotificationStatusSetCallback]。
  • Related APIs: [onConversationTotalUnreadMessageCountUpdated]。
  • Available since: 2.0.0 and above.
  • Restrictions: Valid after login, invalid after logout.

Return

Callback of the set conversation notification status result.

cancelSendingMessage

cancelSendingMessage
public void cancelSendingMessage(ZIMMessage message, ZIMSendingMessageCancelConfig config, ZIMSendingMessageCancelledCallback callback)
Cancels sending of media message.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe message to be cancel sending.
configZIMSendingMessageCancelConfigRelated configuration for cancel sending messages.
callbackZIMSendingMessageCancelledCallbackCallback of the cancel sending result of the message.
  • Related APIs: [queryHistoryMessage], [sendMessage].

Return

Callback of the cancel sending result of the message.

editMessage

editMessage
public void editMessage(ZIMMessage message, ZIMMessageEditConfig config, ZIMMessageSendNotification notification, ZIMMessageEditedCallback callback)
Edit message.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe message to be editing.
configZIMMessageEditConfigRelated configuration for editing messages.
notificationZIMMessageSendNotificationRelated notifications when message is editing.
callbackZIMMessageEditedCallbackCallback of the editing result of the message.
  • Related APIs: [queryHistoryMessage], [sendMessage].

Return

Callback of the editing result of the message.

pinMessage

pinMessage
public void pinMessage(ZIMMessage message, bool isPinned, ZIMMessagePinnedCallback callback)
Pin or unpin message.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe message to be pinned or unpinned.
isPinnedboolTo pin or unpin.
callbackZIMMessagePinnedCallbackCallback of the result of the message to be pinned or unpinned.
  • Related callbacks: [ZIMMessagePinnedCallback], [onMessagePinStatusChanged].
  • Related APIs: [queryPinnedMessageList], [sendMessage].

Return

Callback of the result of the message to be pinned or unpinned.

sendMessage

sendMessage
public void sendMessage(std::shared_ptr<ZIMMessage> message, std::string toConversationID, ZIMConversationType conversationType, ZIMMessageSendConfig config, ZIMMessageSendNotification notification, ZIMMessageSentCallback callback)
send message.
Declared in ZIM.h

Parameters

NameTypeDescription
messagestd::shared_ptr<ZIMMessage>The message to be sent.
toConversationIDstd::stringThe conversation ID the message needs to be sent.
conversationTypeZIMConversationTypeConversation type, supports single chat, room and group chat.
configZIMMessageSendConfigRelated configuration for sending messages.
notificationZIMMessageSendNotificationRelated notifications when messages are sent.
callbackZIMMessageSentCallbackCallback of the sending result of the message.
  • Related APIs: [queryHistoryMessage], [deleteAllMessage], [deleteMessages],[sendMediaMessage].

sendMediaMessage

sendMediaMessage
public void sendMediaMessage(std::shared_ptr<ZIMMediaMessage> message, const std::string & toConversationID, ZIMConversationType conversationType, ZIMMessageSendConfig config, ZIMMediaMessageSendNotification notification, ZIMMessageSentCallback callback)
Send media messages.
Declared in ZIM.h

Parameters

NameTypeDescription
messagestd::shared_ptr<ZIMMediaMessage>When using the message to be sent, modify the type of message according to the type of multimedia message. For example, when sending image messages, use ZIMImageMessage.
toConversationIDconst std::string &The conversation ID of the message recipient, supports single chat, room and group chat.
conversationTypeZIMConversationTypeConversation type, supports single chat, room and group chat.
configZIMMessageSendConfigRelated configuration for sending messages.
notificationZIMMediaMessageSendNotificationRelevant notifications when sending media messages, including upload progress, etc.
callbackZIMMessageSentCallbackResult callback for sending media messages.
  • Impacts on other APIs: [onReceivePeerMessage]/[ReceiveGroupMessage] sessions and session-scoped [onReceiveGroupMessage] sessions did not fire message receiver's [ConversationR] fires [onversationTotalUnreadMessageCountUpdated] objection.

Only required if you need to use the threaded update feature when pushing configuration. Push notifications are not supported, nor are [onContationChanged] and [ConTotalUnreadMessageCountUpdated] supported if media messages are broadcast to the world.

  • Related callbacks: [ZIMMessageSentCallback], [ZIMMediaMessageSendNotification], [onReceivePeMessage], [onReceiveRoomMessage], [onReceiveGroupMessage], [onConversationChanged], [onConversationTotalUnreadMessageCountUpdated].
  • Related APIs: [queryHistoryMessage], [deleteAllMessage], [deleteMessages]

Return

Result for sending media messages.

insertMessageToLocalDB

insertMessageToLocalDB
public void insertMessageToLocalDB(std::shared_ptr<ZIMMessage> message, const std::string & conversationID, ZIMConversationType conversationType, const std::string & senderUserID, ZIMMessageInsertedCallback callback)
Insert a message to the local DB.
Declared in ZIM.h

Parameters

NameTypeDescription
messagestd::shared_ptr<ZIMMessage>The message to be sent.
conversationIDconst std::string &Conversation ID.
conversationTypeZIMConversationTypeConversation type.
senderUserIDconst std::string &The sender ID of this message.
callbackZIMMessageInsertedCallbackThe result callback of the inserted message.

Details

This method can insert a message directly to the local DB on the client side.

  • Use cases: The developer can combine the system message type, and convert the callback notification (for example, invite someone into the group, remove someone from the group, etc.) to the system message type on the client side and insert it into the local DB to achieve the effect of the system prompt .
  • When to call: It can be called after login.
  • Caution: Inserting "command" messages is not supported. To insert a "room" message, upgrade the SDK to 2.13.0 and above.
  • Related callbacks: [ZIMMessageInsertedCallback].
  • Related APIs: [queryHistoryMessage], [deleteAllMessage], [deleteMessages].
  • Available since: 2.4.0 and above.

Return

The result of the inserted message.

clearLocalFileCache

clearLocalFileCache
public void clearLocalFileCache(ZIMFileCacheClearConfig config, ZIMFileCacheClearedCallback callback)
Clear the local message cache of the current user.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMFileCacheClearConfigClear the cache configuration.
callbackZIMFileCacheClearedCallbackReturn the result of clearing the cache.
  • Related callbacks: [ZIMFileCacheClearedCallback].
  • Restrictions: This takes effect after the login and becomes invalid after the logout.

queryLocalFileCache

queryLocalFileCache
public void queryLocalFileCache(ZIMFileCacheQueryConfig config, ZIMFileCacheQueriedCallback callback)
Query the local message cache of the current user.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMFileCacheQueryConfigQuery the cache configuration.
callbackZIMFileCacheQueriedCallbackReturn the result of the query cache.
  • Related callbacks: [ZIMFileCacheQueriedCallback].
  • Restrictions: This takes effect after the login and becomes invalid after the logout.

exportLocalMessages

exportLocalMessages
public void exportLocalMessages(String folderPath, ZIMMessageExportConfig config, ZIMMessageExportingProgress progress, ZIMMessageExportedCallback callback)
Example Export the local message of the current user.
Declared in ZIM.h

Parameters

NameTypeDescription
folderPathStringPlease enter the file saving address, the path is an absolute path.
configZIMMessageExportConfigExport the configuration of the message.
progressZIMMessageExportingProgressReturn of export message progress.
callbackZIMMessageExportedCallbackReturn the result of the exported message.
  • Caution: The name of the message file exported by this interface is zim_backup_msg_text. If the passed in path is the same when calling this interface multiple times, the ZIM SDK will rename the old zim_backup_msg_text file by itself to ensure that the latest exported file name is zim_backup_msg_text.
  • Related callbacks: [ZIMMessageExportedCallback].
  • Restrictions: It takes effect after login and becomes invalid after logout.

importLocalMessages

importLocalMessages
public void importLocalMessages(String folderPath, ZIMMessageImportConfig config, ZIMMessageImportingProgress progress, ZIMMessageImportedCallback callback)
Example Import the local message of the current user.
Declared in ZIM.h

Parameters

NameTypeDescription
folderPathStringEnter the address of the directory where the imported file resides. The path is an absolute path, excluding the file name.
configZIMMessageImportConfigImport the configuration of the message.
progressZIMMessageImportingProgressReturn of import message progress.
callbackZIMMessageImportedCallbackReturn the result of the imported message.
  • Caution: The ZIM SDK reads a file named zim_backup_msg_text in the directory by default. If there are multiple backups in this path, please confirm whether the name of the file to be imported is zim_backup_msg_text.
  • Related callbacks: [ZIMMessageImportedCallback].
  • Restrictions: It takes effect after login and becomes invalid after logout.

sendConversationMessageReceiptRead

sendConversationMessageReceiptRead
public void sendConversationMessageReceiptRead(String conversationID, ZIMConversationType conversationType, ZIMConversationMessageReceiptReadSentCallback callback)
Sets all received receipts for the conversation as read.
Declared in ZIM.h

Parameters

NameTypeDescription
conversationIDStringConversation ID.
conversationTypeZIMConversationTypeConversation type, only Peer type is supported.
callbackZIMConversationMessageReceiptReadSentCallbackSet Conversation read callback.

Details

Set all received receipts of the conversation to be read.

  • Use cases: Set all received receipt messages in the entire conversation to be read, and the sender of the message receipt in the conversation will receive the [onConversationMessageReceiptChanged] callback from ZIMEventHandler.
  • When to call: It can be called after login. It is recommended to call before entering the message list page. In the message list page, it is recommended to call [sendMessageReceiptsRead] to batch set the messages that need to be read.
  • Caution: Only single chat conversation are allowed.

Related callback: [ZIMConversationMessageReceiptReadSentCallback].

  • Related APIs: [sendMessageReceiptsRead], [sendMessage].
  • Available since: 2.5.0 and above.

Return

Set Conversation read callback.

sendMessageReceiptsRead

sendMessageReceiptsRead
public void sendMessageReceiptsRead(const std::vector<std::shared_ptr<ZIMMessage>> &messageList, messageList, const std::string & conversationID, ZIMConversationType conversationType, ZIMMessageReceiptsReadSentCallback callback)
Set the receipt of a batch of messages to become read.
Declared in ZIM.h

Parameters

NameTypeDescription
messageListconst std::vector<std::shared_ptr<ZIMMessage>> &messageList,The list of messages to be read with no more than 10 messages.
conversationIDconst std::string &Conversation ID.
conversationTypeZIMConversationTypeConversation type.
callbackZIMMessageReceiptsReadSentCallbackSet the result callback of the read message.

Details

This method can set the receipt of a batch of messages to become read.

  • Use cases: Developers can use this method to set a batch of messages with receipts that have been read. If the sender is online, it will receive the [onMessageReceiptChanged] callback.
  • When to call: Callable after login. It is recommended to set the settings for the messages that need to be read on the message list page. It is not recommended to mix with [sendConversationMessageReceiptRead].
  • Related callbacks: [ZIMMessageReceiptsReadSentCallback].
  • Related APIs: [sendMessage].
  • Available since: 2.5.0 and above.
  • Restrictions: Only support the settings for received messages with receipt status as PROCESSING.

Return

Set the result callback of the read message.

queryMessageReceiptsInfo

queryMessageReceiptsInfo
public void queryMessageReceiptsInfo(const std::vector<std::shared_ptr<ZIMMessage>> &messageList, messageList, const std::string & conversationID, ZIMConversationType conversationType, ZIMMessageReceiptsInfoQueriedCallback callback)
Query the receipt information of a batch of messages.
Declared in ZIM.h

Parameters

NameTypeDescription
messageListconst std::vector<std::shared_ptr<ZIMMessage>> &messageList,list of messages to query.
conversationIDconst std::string &Conversation ID.
conversationTypeZIMConversationTypeConversation type.
callbackZIMMessageReceiptsInfoQueriedCallbackCallback for the result of querying message receipt information.

Details

This method can query the receipt information of a batch of messages, including the status, the number of unread users and the number of read users.

  • Use cases: If you need to query the receipt status of the message, the number of unread users and the number of read users, you can call this interface.
  • When to call: Callable after login. If you need to query the detailed member list, you can query through the interface [queryGroupMessageReceiptReadMemberList] or [queryGroupMessageReceiptUnreadMemberList].
  • Related callbacks: [ZIMMessageReceiptsInfoQueriedCallback].
  • Related APIs: [queryGroupMessageReceiptReadMemberList] , [queryGroupMessageReceiptUnreadMemberList].
  • Available since: 2.5.0 and above.
  • Restrictions: Only messages whose statuses are not NONE are supported.

Return

Callback for the result of querying message receipt information.

queryGroupMessageReceiptReadMemberList

queryGroupMessageReceiptReadMemberList
public void queryGroupMessageReceiptReadMemberList(std::shared_ptr<ZIMMessage> message, const std::string & groupID, ZIMGroupMessageReceiptMemberQueryConfig config, ZIMGroupMessageReceiptMemberListQueriedCallback callback)
Query the list of read members of the group
Declared in ZIM.h

Parameters

NameTypeDescription
messagestd::shared_ptr<ZIMMessage>list of messages to query.
groupIDconst std::string &Group ID.
configZIMGroupMessageReceiptMemberQueryConfigquery configuration.
callbackZIMGroupMessageReceiptMemberListQueriedCallbackQuery the result callback of the specific read member list.

Details

This method can query the specific read member list of a message sent by a group.

  • Use cases: Developers can use this method to query the specific read member list of a message they send.
  • When to call: Callable after login.
  • Related callbacks: [ZIMGroupMessageReceiptMemberListQueriedCallback].
  • Related APIs: If you need to query the receipt status of a certain message or only need to query the read/unread count, you can query through the interface [queryMessageReceiptsInfo].
  • Available since: 2.5.0 and above.
  • Restrictions: only supports querying the messages sent by the local end, and the receipt status of the messages is not NONE. If the user is not in the group, or has been kicked out of the group, the corresponding member list cannot be found.

Return

Query the result callback of the specific read member list.

queryGroupMessageReceiptUnreadMemberList

queryGroupMessageReceiptUnreadMemberList
public void queryGroupMessageReceiptUnreadMemberList(std::shared_ptr<ZIMMessage> message, const std::string & groupID, ZIMGroupMessageReceiptMemberQueryConfig config, ZIMGroupMessageReceiptMemberListQueriedCallback callback)
Query the list of read members of the group.
Declared in ZIM.h

Parameters

NameTypeDescription
messagestd::shared_ptr<ZIMMessage>Message to query
groupIDconst std::string &Group ID.
configZIMGroupMessageReceiptMemberQueryConfigquery configuration
callbackZIMGroupMessageReceiptMemberListQueriedCallbackQuery the result callback of the specific read member list.

Details

This method can query the specific unread member list of a message sent by a group.

  • Use cases: Developers can use this method to query the specific unread member list of a message they send.
  • When to call: Callable after login.
  • Related callbacks: [ZIMGroupMessageReceiptMemberListQueriedCallback].
  • Related APIs: If you need to query the receipt status of a certain message or only need to query the read/unread count, you can query through the interface [queryMessageReceiptsInfo].
  • Available since: 2.5.0 and above.
  • Restrictions: only supports querying the messages sent by the local end, and the receipt status of the messages is not NONE. If the user is not in the group, or has been kicked out of the group, the corresponding member list cannot be found.

Return

Query the result callback of the specific read member list.

searchLocalMessages

searchLocalMessages
public void searchLocalMessages(const std::string & conversationID, ZIMConversationType conversationType, const ZIMMessageSearchConfig & config, ZIMMessagesSearchedCallback callback)
Search local message list.
Declared in ZIM.h

Parameters

NameTypeDescription
conversationIDconst std::string &The conversation ID of the local message to be search.
conversationTypeZIMConversationTypeconversation type.
configconst ZIMMessageSearchConfig &Search the configuration of local messages.
callbackZIMMessagesSearchedCallbackCallback of the search local message result.
  • Related callbacks: [ZIMMessagesSearchedCallback].
  • Restrictions: Effective after login, invalid after logout. Searching is not supported in the room scene (conversationType=1).

Return

Callback of the search local message result.

searchLocalConversations

searchLocalConversations
public void searchLocalConversations(const ZIMConversationSearchConfig & config, ZIMConversationsSearchedCallback callback)
Search local conversations on local messages.
Declared in ZIM.h

Parameters

NameTypeDescription
configconst ZIMConversationSearchConfig &Global search conversation config.
callbackZIMConversationsSearchedCallbackCallback of the search conversations result.
  • Related callbacks: [ZIMConversationsSearchedCallback].
  • Restrictions: effective after logging in and becomes invalid after logging out. Searching is not supported in room scenarios (conversationType=1).

Return

Callback of the search conversations message result.

searchGlobalLocalMessages

searchGlobalLocalMessages
public void searchGlobalLocalMessages(const ZIMMessageSearchConfig & config, ZIMMessagesGlobalSearchedCallback callback)
Search global local message list.
Declared in ZIM.h

Parameters

NameTypeDescription
configconst ZIMMessageSearchConfig &Search global the configuration of local messages.
callbackZIMMessagesGlobalSearchedCallbackCallback of the search global local message result.
  • Related callbacks: [ZIMMessagesGlobalSearchedCallback].
  • Restrictions: Effective after login, invalid after logout. Searching global is not supported in the room scene (conversationType=1).

Return

Callback of the search global local message result.

replyMessage

replyMessage
public void replyMessage(std::shared_ptr<ZIMMessage> message, std::shared_ptr<ZIMMessage> toOriginalMessage, ZIMMessageSendConfig config, ZIMMessageSendNotification notification, ZIMMessageSentCallback callback)
send reply message.
Declared in ZIM.h

Parameters

NameTypeDescription
messagestd::shared_ptr<ZIMMessage>The message to be sent. Only supports: ZIMTextMessage(1), ZIMImageMessage(11), ZIMFileMessage(12), ZIMAudioMessage(13), ZIMVideoMessage(14), ZIMCombineMessage(100), ZIMCustomMessage(200)."
toOriginalMessagestd::shared_ptr<ZIMMessage>The source message to be quoted. Only supports: ZIMTextMessage(1), ZIMImageMessage(11), ZIMFileMessage(12), ZIMAudioMessage(13), ZIMVideoMessage(14), ZIMCombineMessage(100), ZIMCustomMessage(200)."
configZIMMessageSendConfigRelated configuration for sending messages.
notificationZIMMessageSendNotificationRelated notifications when messages are sent.
callbackZIMMessageSentCallbackCallback of the sending result of the message.
  • Related APIs: [queryHistoryMessage], [sendMessage], [sendMediaMessage].

queryMessageRepliedList

queryMessageRepliedList
public void queryMessageRepliedList(ZIMMessage message, ZIMMessageRepliedListQueryConfig config, ZIMMessageRepliedListQueriedCallback callback)
Query the reply list.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageAny message in the reply list.
configZIMMessageRepliedListQueryConfigquery configuration
callbackZIMMessageRepliedListQueriedCallbackThe query result callback.

Details

Query the reply message list.

  • Use cases: Developers can use this method to query the entire reply message tree.
  • When to call: Callable after login.
  • Available since: 2.17.0 and above.

Return

The query result callback.

sendMediaMessage

sendMediaMessage
public void sendMediaMessage(ZIMMediaMessage * message, const std::string& toConversationID, ZIMConversationType conversationType, ZIMMessageSendConfig config, ZIMMediaUploadingProgress progress, ZIMMessageSentCallback callback)
Send media messages.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMediaMessage *The message to be sent.
toConversationIDconst std::string&The conversation ID of the message recipient, supports single chat, room and group chat.
conversationTypeZIMConversationTypeConversation type, supports single chat, room and group chat.
configZIMMessageSendConfigRelated configuration for sending messages.
progressZIMMediaUploadingProgressProgress callback for sending media messages.
callbackZIMMessageSentCallbackResult callback for sending media messages.

Details

Supported versions: 2.1.0 and above.

Detailed description: This method can be used to send messages in single chat, room and group chat.

Business scenario: When you need to send media to the target user, target message room, and target group chat after logging in, send it through this interface.

Call timing/Notification timing: It can be called after login.

Usage limit: no more than 10/s, available after login, unavailable after logout.

Impact: [onReceivePeerMessage]/[ReceiveGroupMessage] sessions and session-scoped [onReceiveGroupMessage] sessions did not fire message receiver's [ConversationR] fires [onversationTotalUnreadMessageCountUpdated] objection.

Only required if you need to use the threaded update feature when pushing configuration. Push notifications are not supported, nor are [onContationChanged] and [ConTotalUnreadMessageCountUpdated] supported if media messages are broadcast to the world.

Related: [ZIMMessageSentCallback], [ZIMMediaUploadingProgress], [onReceivePeMessage], [onReceiveRoomMessage], [onReceiveGroupMessage], [onConversationChanged], [onConversationTotalUnreadMessageCountUpdated].

Related interfaces: [queryHistoryMessage], [deleteAllMessage], [deleteMessages]

Return

Result for sending media messages.

downloadMediaFile

downloadMediaFile
public void downloadMediaFile(ZIMMediaMessage * message, ZIMMediaFileType fileType, ZIMMediaDownloadConfig config, ZIMMediaDownloadingProgress progress, ZIMMediaDownloadedCallback callback)
Download media file message content.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMediaMessage *The media file message to download.
fileTypeZIMMediaFileTypeMedia file type.
configZIMMediaDownloadConfigDownload the configuration object.
progressZIMMediaDownloadingProgressProgress callback for downloading media files.
callbackZIMMediaDownloadedCallbackResult callback for downloading media files.
  • Related callbacks: [ZIMMediaDownloadedCallback], [ZIMMediaDownloadingProgress].
  • Restrictions: If you download an external URL, you can only download a maximum of 200MB of resources. For configuration, please contact ZEGO technical support.

Return

Result for downloading media files.

downloadMediaFile

downloadMediaFile
deprecated
public void downloadMediaFile(ZIMMediaMessage * message, ZIMMediaFileType fileType, ZIMMediaDownloadingProgress progress, ZIMMediaDownloadedCallback callback)
Download media message content.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMediaMessage *The media message to download.
fileTypeZIMMediaFileTypeMedia file type.
progressZIMMediaDownloadingProgressProgress callback for downloading media files.
callbackZIMMediaDownloadedCallbackResult callback for downloading media files.
  • Related callbacks: [ZIMMediaDownloadedCallback], [ZIMMediaDownloadingProgress].
  • Restrictions: If you download an external URL, you can only download a maximum of 200MB of resources. For configuration, please contact ZEGO technical support.
Deprecated
This API has been deprecated since version 2.19.0. Please use the interface with the same name, [downloadMediaFile], instead.

Return

Result for downloading media files.

sendPeerMessage

sendPeerMessage
deprecated
public void sendPeerMessage(ZIMMessage * message, const std::string& toUserID, ZIMMessageSendConfig config, ZIMMessageSentCallback callback)
Send peer-to-peer messages.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessage *The message to be sent.
toUserIDconst std::string&The ID of the user who will receive the message.
configZIMMessageSendConfigRelated configuration for sending single chat messages.
callbackZIMMessageSentCallbackCallback of the sending result of the message.

Details

After this function is called, a message is sent to the specified user. At the same time, a [ZIMMessageSentCallback] callback is received, which can be used to determine whether the message is sent successfully.

  • Use cases: This function is used in 1V1 chat scenarios.

Call timing/Notification timing: Can be invoked after login.

  • Caution: Be aware of the [ZIMMessageSentCallback] callback when sending. This callback can be used to determine if the send fails for some reason.Pushconfig Is required only when the offline push function is required.

Usage limit: no more than 10 /s, available after login, unavailable after logout.

Scope of influence: Using this method triggers the [receivePeerMessage] callback of the message receiver and the [onConversationChanged] callback of the sender and receiver. If message DND is not set for the session where the message is sent, Triggers [conversationTotalUnreadMessageCountUpdated] callback.

  • Related callbacks: [ZIMMessageSentCallback]、[receivePeerMessage]、[onConversationChanged]、[conversationTotalUnreadMessageCountUpdated]。

Related API: [queryHistoryMessage]、[deleteMessageByConversationID]、[deleteMessage]

  • Available since: 2.0.0 and above.
Deprecated
This API has been deprecated since 2.4.0, use [sendMessage] instead.

Return

Callback of the sending result of the message.

sendRoomMessage

sendRoomMessage
deprecated
public void sendRoomMessage(ZIMMessage * message, const std::string& toRoomID, ZIMMessageSendConfig config, ZIMMessageSentCallback callback)
Send room messages.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessage *The message to be sent.
toRoomIDconst std::string&The ID of the room which will receive the message.
configZIMMessageSendConfigRelated configuration for sending room messages.
callbackZIMMessageSentCallbackCallback of the sending result of the message.

Details

When this function is called, the message will be sent in the room. At the same time, the [ZIMMessageSentCallback] callback will be received, which can be used to determine whether the message was sent successfully.

Use Cases: This feature is required for scenarios where multiple people in the room are chatting.

  • Available since: 1.1.0 or above
Deprecated
This API has been deprecated since 2.4.0, use [sendMessage] instead.

Return

Callback of the sending result of the message.

sendGroupMessage

sendGroupMessage
deprecated
public void sendGroupMessage(ZIMMessage * message, const std::string& toGroupID, ZIMMessageSendConfig config, ZIMMessageSentCallback callback)
Send group messages.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessage *The message to be sent.
toGroupIDconst std::string&The ID of the user who will receive the message.
configZIMMessageSendConfigRelated configuration for sending single chat messages.
callbackZIMMessageSentCallbackCallback of the sending result of the message.

Details

This interface is invoked when a group chat message needs to be sent.

Service scenario: This interface can be used when sending group messages.

Call timing/Notification timing: This interface is called when a group chat message needs to be sent.

Usage restrictions: No more than 10 pieces /s, available after login, unavailable after logout.

pushconfig is only required to use the offline push function.

Scope of influence: Using this method triggers the onReceiveGroupMessage callback of the message recipient and the onConversationChanged callback of the sender and receiver. If messages are not set for the session where the message resides, Trigger onConversationTotalUnreadMessageCountUpdated callback.

The callback: [ZIMMessageSentCallback]、[onReceiveGroupMessage]、[onConversationChanged]、[onConversationTotalUnreadMessageCountUpdated].

Relevant interface: [queryHistoryMessage], [deleteMessage].

Deprecated
This API has been deprecated since 2.4.0, use [sendMessage] instead.

Return

Callback of the sending result of the message.

queryHistoryMessage

queryHistoryMessage
public void queryHistoryMessage(const std::string& conversationID, ZIMConversationType conversationType, ZIMMessageQueryConfig config, ZIMMessageQueriedCallback callback)
Query historical messages.
Declared in ZIM.h

Parameters

NameTypeDescription
conversationIDconst std::string&The session ID of the queried historical message.
conversationTypeZIMConversationTypeconversation type.
configZIMMessageQueryConfigQuery the configuration of historical messages.
callbackZIMMessageQueriedCallbackReturns the result of querying historical messages.
  • Related callbacks: [ZIMMessageQueriedCallback].
  • Restrictions: Effective after login, invalid after logout. In the default room scenario (conversationType=1), offline message is disabled. If you need to enable it, please contact the corresponding technical support.

Return

Callback of the query history message result.

queryPinnedMessageList

queryPinnedMessageList
public void queryPinnedMessageList(const std::string& conversationID, ZIMConversationType conversationType, ZIMMessageQueriedCallback callback)
Query pinned message list.
Declared in ZIM.h

Parameters

NameTypeDescription
conversationIDconst std::string&The conversation ID of the queried pinned message.
conversationTypeZIMConversationTypeconversation type.
callbackZIMMessageQueriedCallbackReturns the result of querying historical messages.
  • Related callbacks: [ZIMPinnedMessageListQueriedCallback].
  • Restrictions: The SDK must be logged in and the message pinning feature must be supported to use this interface.

Return

Callback of the query pinned message result.

queryMessages

queryMessages
public void queryMessages(std::vector<long> messageSeqs, std::string conversationID, ZIMConversationType conversationType, ZIMMessageQueriedCallback callback)
Query messages based on the message seq list.
Declared in ZIM.h

Parameters

NameTypeDescription
messageSeqsstd::vector<long>The message seq list to be queried.
conversationIDstd::stringThe conversation ID of the queried message.
conversationTypeZIMConversationTypeconversation type.
callbackZIMMessageQueriedCallbackReturns the result of querying messages.

Details

Supported versions: 2.17.0 and above.

Detailed description: Query a batch of messages based on the message seq list.

Business scenario: Jump to the source message location quoted by the reply message on the chat page.

Return

Returns the result of querying messages.

deleteAllConversationMessages

deleteAllConversationMessages
public void deleteAllConversationMessages(ZIMMessageDeleteConfig config, ZIMConversationMessagesAllDeletedCallback callback)
Delete all messages for all sessions.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMMessageDeleteConfigDelete the configuration of the message.
callbackZIMConversationMessagesAllDeletedCallbackReturn the result of deleting all messages for all sessions.
  • Impacts on other APIs: Call the interface trigger [onMessageDeleted] callback, if there are unread messages at this time, will trigger [onConversationTotalUnreadMessageCountUpdated] callback.
  • Related callbacks: [ZIMConversationMessagesAllDeletedCallback]、[onMessageDeleted]、[onConversationTotalUnreadMessageCountUpdated].
  • Restrictions: Effective after login.

Return

Return the result of deleting all messages for all conversations.

queryCombineMessageDetail

queryCombineMessageDetail
public void queryCombineMessageDetail(const std::shared_ptr<ZIMCombineMessage> & message, ZIMCombineMessageDetailQueriedCallback callback)
query combine message detail
Declared in ZIM.h

Parameters

NameTypeDescription
messageconst std::shared_ptr<ZIMCombineMessage> &The combine message needs querying message list.
callbackZIMCombineMessageDetailQueriedCallbackCallback parameters for querying merge message details.
  • Use cases: If you need to obtain the specific sub-messages under the combine message, you can call this API to query.
  • Restrictions: You can only use it after logging in.

Return

Returns the result of querying combine message detail.

revokeMessage

revokeMessage
public void revokeMessage(std::shared_ptr<ZIMMessage> message, const ZIMMessageRevokeConfig & config, ZIMMessageRevokedCallback callback)
revoke message.
Declared in ZIM.h

Parameters

NameTypeDescription
messagestd::shared_ptr<ZIMMessage>The message needs to be revoke.
configconst ZIMMessageRevokeConfig &Revoke the configuration of the message.
callbackZIMMessageRevokedCallbackReturns the result of revoking the message.
  • Use cases: The user needs to recall a message. This method can be used when the user does not want other users to see the message.
  • When to call: Called when the message needs to be revoked.

Room message revoke is not supported.

  • Related callbacks: If the revoked message is the latest message of the session, the [conversationChanged] callback will be triggered, and if the message is unread, the [conversationTotalUnreadMessageCountUpdated] callback will be triggered.
  • Restrictions: Login is required to use. To revoke messages from other members within the group, the group owner needs to use version 2.9.0 or above.

Return

Returns the result of revoking the message.

deleteMessages

deleteMessages
public void deleteMessages(std::vector<ZIMMessage *> messageList, const std::string& conversationID, ZIMConversationType conversationType, ZIMMessageDeleteConfig config, ZIMMessageDeletedCallback callback)
delete message.
Declared in ZIM.h

Parameters

NameTypeDescription
messageListstd::vector<ZIMMessage *>List of deleted messages.
conversationIDconst std::string&The session ID of the deleted message.
conversationTypeZIMConversationTypeconversation type.
configZIMMessageDeleteConfigDelete the configuration of the message.
callbackZIMMessageDeletedCallbackReturns the result of deleting the message.
  • Impacts on other APIs: If the deleted message is the latest message of the session, the [conversationChanged] callback will be triggered, and if the message is unread, the [conversationTotalUnreadMessageCountUpdated] callback will be triggered.
  • Related callbacks: [ZIMMessageDeletedCallback]、[conversationChanged]、[conversationTotalUnreadMessageCountUpdated].
  • Restrictions: Effective after login.

Return

Returns the result of deleting the message.

addMessageReaction

addMessageReaction
public void addMessageReaction(std::string reactionType, std::shared_ptr<ZIMMessage> message, ZIMMessageReactionAddedCallback callback)
add message reaction
Declared in ZIM.h

Parameters

NameTypeDescription
reactionTypestd::stringType of reaction, defined by you, with a maximum length of 32 bytes.
messagestd::shared_ptr<ZIMMessage>The message needs reaction.
callbackZIMMessageReactionAddedCallbackReturns the result of adding message reaction.
  • Use cases: Users need to express their position on a certain message, such as liking, and this method can be used to express their position.

Room message reaction is not supported.

  • Related callbacks: If the addition is successful, the [onMessageReactionsChanged] callback will be triggered. If the reaction is made to the latest message in the conversation, the [onConversationChanged] callback will be triggered when the addition is successful.
  • Restrictions: You can only use it after logging in. And only supports message reactions for single chat and group chat

Return

Returns the result of adding reaction.

deleteMessageReaction

deleteMessageReaction
public void deleteMessageReaction(std::string reactionType, std::shared_ptr<ZIMMessage> message, ZIMMessageReactionDeletedCallback callback)
delete message reaction
Declared in ZIM.h

Parameters

NameTypeDescription
reactionTypestd::stringReaction type. It must be the type of reaction made by the local user.
messagestd::shared_ptr<ZIMMessage>The message needs reaction delete.
callbackZIMMessageReactionDeletedCallbackReturns the result of revoking the message.
  • Use cases: Users need to delete the status of a message that has already been stated, which can be done using this method.

Room message reaction is not supported.

  • Related callbacks: If the deletion is successful, the [onMessageReactionsChanged] callback will be triggered. If the reaction is deleted from the latest message in the conversation, the [onConversationChanged] callback will be triggered when the addition is successful.
  • Restrictions: You can only use it after logging in. And only supports message statements for single chat and group chat

Return

Returns the result of deleting reaction.

queryMessageReactionUserList

queryMessageReactionUserList
public void queryMessageReactionUserList(const std::shared_ptr<ZIMMessage> & message, const ZIMMessageReactionUserQueryConfig & config, ZIMMessageReactionUserListQueriedCallback callback)
query message reaction userlist
Declared in ZIM.h

Parameters

NameTypeDescription
messageconst std::shared_ptr<ZIMMessage> &The message needs querying reaction user list.
configconst ZIMMessageReactionUserQueryConfig &reaction user query config.
callbackZIMMessageReactionUserListQueriedCallbackthe result of querying reaction user list.
  • Use cases: When it is necessary to obtain specific user information under a certain state of a message, this interface can be called to query state user messages in a paginated manner.
  • Restrictions: You can only use it after logging in. And only supports message statements for single chat and group chat

Return

Returns the result of querying reaction user list.

deleteAllMessage

deleteAllMessage
public void deleteAllMessage(const std::string& conversationID, ZIMConversationType conversationType, ZIMMessageDeleteConfig config, ZIMMessageDeletedCallback callback)
Delete all message.
Declared in ZIM.h

Parameters

NameTypeDescription
conversationIDconst std::string&The session ID of the message to be deleted.
conversationTypeZIMConversationTypeconversation type.
configZIMMessageDeleteConfigdelete session configuration.
callbackZIMMessageDeletedCallbackReturns the result of deleting a message by session ID.
  • Impacts on other APIs: The [conversationChanged] callback is triggered, and if there are unread messages, the [conversationTotalUnreadMessageCountUpdated] callback is triggered.
  • Related callbacks: [ZIMMessageDeletedCallback].
  • Restrictions: Effective after login, invalid after logout.

The impact of deleting messages is limited to this account, and messages from other accounts will not be deleted.

Return

Returns the result of deleting the message.

updateMessageLocalExtendedData

updateMessageLocalExtendedData
public void updateMessageLocalExtendedData(const std::string & localExtendedData, const std::shared_ptr<ZIMMessage> & message, ZIMMessageLocalExtendedDataUpdatedCallback callback)
Update the local expandable field of the message.
Declared in ZIM.h

Parameters

NameTypeDescription
localExtendedDataconst std::string &The expandable message field visible only on this end can store additional information locally and currently has a length limit of 128K. If you have special requirements, please contact ZEGO technical support for configuration.
messageconst std::shared_ptr<ZIMMessage> &Message body to be updated
callbackZIMMessageLocalExtendedDataUpdatedCallbackCallback function to modify local extension fields.

Details

After the user logs in, calling this interface allows updating the local expandable field of the message.

  • When to call: After the user is logged in.
  • Privacy reminder: Please avoid passing sensitive personal information, including but not limited to phone numbers, ID card numbers, passport numbers, real names, etc.
  • Related callbacks: [ ZIMMessageLocalExtendedDataUpdatedCallback ].
  • Available since: 2.2.0 or above.

Return

The result of the update user extended data.

createRoom

createRoom
public void createRoom(const ZIMRoomInfo & roomInfo, ZIMRoomCreatedCallback callback)
Create and join a room.
Declared in ZIM.h

Parameters

NameTypeDescription
roomInfoconst ZIMRoomInfo &The configuration information of the room to be created.
callbackZIMRoomCreatedCallbackCallback of the result of creating the room.

Details

Users can create and join rooms through this api, other users can join this room through [joinRoom] function.

  • Use cases: When you need to create a multi-person chat scene, you can create and join a room by this API.
  • When to call: It can be called after creating a ZIM instance through [create].
  • Caution: When everyone leaves the room, the room will be automatically destroyed. If the room already exists, an error will occur when calling this API. For details, please refer to the returned error code handling.
  • Related callbacks: The result of the room creation can be obtained through the [onRoomCreated] callback.
  • Related APIs: You can join the room through [joinRoom] and leave the room with [leaveRoom].
  • Available since: 1.1.0 or above.

queryRoomMembers

queryRoomMembers
public void queryRoomMembers(const std::vector\<std::string\> & userIDs, const std::string & roomID, ZIMRoomMembersQueriedCallback callback)
Query the information of up to ten users in the specified room.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsconst std::vector<std::string> &List of user IDs to query.
roomIDconst std::string &The room ID of the specified room.
callbackZIMRoomMembersQueriedCallbackCallback for querying room user information.

Details

This method can query the information of up to ten users in the specified room of the logged-in user.

  • Use cases: When you need to know the user information in the specified room, you can call this interface to obtain the data source.
  • When to call /Trigger: Can be invoked after login.
  • Available since: 2.8.0 and above.
  • Restrictions: Available after login, unavailable after logout, up to ten users can be queried at one time.

setRoomMembersAttributes

setRoomMembersAttributes
public void setRoomMembersAttributes(const std::unordered_map<std::string, std::string> & attributes, const std::vector<std::string> & userIDs, const std::string & roomID, ZIMRoomMemberAttributesSetConfig config, ZIMRoomMembersAttributesOperatedCallback callback)
Set room member attributes (use this for all additions and changes).
Declared in ZIM.h

Parameters

NameTypeDescription
attributesconst std::unordered_map<std::string, std::string> &Room member attributes to be set.
userIDsconst std::vector<std::string> &A list of userIDs to set.
roomIDconst std::string &Room ID.
configZIMRoomMemberAttributesSetConfigBehavior configuration of the operation.
callbackZIMRoomMembersAttributesOperatedCallbackAction callback for setting room members attributes.

Details

Supported Versions: 2.4.0 and above.

Detail description: Call this API to set room user properties of members in the room.

Business scenario: If you need to set a level for members in the room, you can use this interface to set a state.

Default: [ZIMRoomMemberAttributesSetConfig] Default constructor isDeleteAfterOwnerLeft is true.

Call timing: After logging in and calling in the relevant room.

Usage limit: A maximum of 500 user attributes can be set in each room and stored in the key-value mode. If you need to increase the attribute limit, please contact ZEGO technical support. The total length of user attribute key-values owned by each user in a room cannot exceed 144 bytes, and the number of key-values cannot exceed 30 pairs. The length of a single key-value cannot exceed 8 bytes for a Key and 64 bytes for a Value. If you need to raise the cap, please contact ZEGO technical support. After the room is destroyed, the user-defined user properties are also destroyed.

Relevant callbacks: [ZIMRoomMembersAttributesOperatedCallback],[onRoomMemberAttributesUpdated].

Related interfaces: [queryRoomMembersAttributes], [queryRoomMemberAttributesList].

Return

Operation result for setting room members attributes.

queryRoomMembersAttributes

queryRoomMembersAttributes
public void queryRoomMembersAttributes(const std::vector<std::string> & userIDs, std::string roomID, ZIMRoomMembersAttributesQueriedCallback callback)
Batch query the room user attributes of the members in the room.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsconst std::vector<std::string> &A list of userIDs to query.
roomIDstd::stringRoom ID.
callbackZIMRoomMembersAttributesQueriedCallbackCallback for the result of batch query of room user attributes.

Details

Call this API to batch query the room user attributes of the members in the room.

  • Use cases: Use this interface when you need to specify that you want to query some room users.
  • Related callbacks: [ZIMRoomMembersAttributesQueriedCallback].
  • Related APIs: [setRoomMembersAttributes]、[queryRoomMemberAttributesList].
  • Runtime lifecycle: It is available after logging in and joining the corresponding room, but unavailable after leaving the corresponding room.
  • Available since: 2.4.0 or later.
  • Restrictions: The maximum call frequency is 5 times within 30 seconds by default, and the maximum query time is 100 people.

Return

The result of batch query of room user attributes.

queryRoomMemberAttributesList

queryRoomMemberAttributesList
public void queryRoomMemberAttributesList(const std::string & roomID, ZIMRoomMemberAttributesQueryConfig config, ZIMRoomMemberAttributesListQueriedCallback callback)
paginate the room user properties that have room property members in the room.
Declared in ZIM.h

Parameters

NameTypeDescription
roomIDconst std::string &Room ID.
configZIMRoomMemberAttributesQueryConfigBehavior configuration of the operation.
callbackZIMRoomMemberAttributesListQueriedCallbackResult callback for querying member attributes in the room.

Details

paginate the room user properties that have room property members in the room.

  • Use cases: This interface is used when you need to query all room users.
  • Related callbacks: [ZIMRoomMemberAttributesListQueriedCallback].
  • Related APIs: [setRoomMembersAttributes]、[queryRoomMembersAttributes].
  • Runtime lifecycle: It is available after logging in and joining the corresponding room, but unavailable after leaving the corresponding room.
  • Available since: 2.4.0 or later.
  • Restrictions: The maximum call frequency is 5 times within 30 seconds by default, and the maximum query time is 100 people.

Return

Result of paging query for room user properties.

createRoom

createRoom
public void createRoom(ZIMRoomInfo roomInfo, ZIMRoomAdvancedConfig config, ZIMRoomCreatedCallback callback)
Create a room with advanced settings
Declared in ZIM.h

Parameters

NameTypeDescription
roomInfoZIMRoomInfoThe configuration information of the room to be created.
configZIMRoomAdvancedConfigThe advanced properties of the room to be created.
callbackZIMRoomCreatedCallbackCallback of the result of creating the room.

Details

Users can create and join rooms through this api, other users can join this room through [joinRoom] function.

  • Available since: 1.3.0.

Return

Callback of the result of creating the room.

enterRoom

enterRoom
public void enterRoom(ZIMRoomInfo roomInfo, ZIMRoomAdvancedConfig config, ZIMRoomEnteredCallback callback)
Enter the room. If the room does not exist, it will be created automatically.
Declared in ZIM.h

Parameters

NameTypeDescription
roomInfoZIMRoomInfoConfiguration information for the room that will be created. Only the first user who enters the room creates roomName and takes effect.
configZIMRoomAdvancedConfigAdvanced properties of the room that will be created. Only the first user who enters the room is configured to take effect.
callbackZIMRoomEnteredCallbackCallback of the result of entering the room.
  • When to call: It can be called after logging in.

When everyone leaves the room, the room will be automatically destroyed, and a user can be in a maximum of 5 rooms at the same time. [enterRoom] is equivalent to [createRoom] and [joinRoom], so you only need to choose one of the APIs.

  • Related callbacks: The result of entering the room can be obtained through the [onRoomEntered] callback.
  • Related APIs: You can enter the room through [enterRoom], and leave the room through [leaveRoom].

Return

Callback of the result of entering the room.

switchRoom

switchRoom
public void switchRoom(std::string fromRoomID, const ZIMRoomInfo & toRoomInfo, bool isCreateWhenRoomNotExisted, const ZIMRoomAdvancedConfig & config, ZIMRoomSwitchedCallback callback)
Switch from one room to another. If the room does not exist, it will decide whether to create the corresponding room based on the passed parameters.
Declared in ZIM.h

Parameters

NameTypeDescription
fromRoomIDstd::stringConfiguration information for the room that will be created. Only the first user who enters the room creates roomName and takes effect.
toRoomInfoconst ZIMRoomInfo &Basic information of the room to be switched to. The roomName field is only valid when the room to be switched to does not exist and the isCreateWhenRoomNotExisted field is true.
isCreateWhenRoomNotExistedboolWhen the room to be switched to does not exist, decide whether to create the corresponding room based on this field.
configconst ZIMRoomAdvancedConfig &If the isCreateWhenRoomNotExisted field is true and the room to be switched to does not exist, create the room advanced property configuration used by the corresponding room.
callbackZIMRoomSwitchedCallbackCallback of the result of switching the room.
  • When to call: It can be called after logging in.
  • Related callbacks: The result of switching the room can be obtained through the [ZIMRoomSwitchedCallback] callback.

Return

Callback of the result of switching the room.

joinRoom

joinRoom
public void joinRoom(const std::string& roomID, ZIMRoomJoinedCallback callback)
Join a room.
Declared in ZIM.h

Parameters

NameTypeDescription
roomIDconst std::string&ID of the room to join.
callbackZIMRoomJoinedCallbackCallback of the result of joining the room.

Details

If the room does not exist, the join fails and you need to call [createRoom] to create the room first.

  • Use cases: In a multi-person chat scenario, users can call this interface to enter the room when they need to join the room.
  • When to call: It can be called after creating a ZIM instance through [create].
  • Caution: When everyone leaves the room, the room will be automatically destroyed.
  • Related callbacks: The result of joining the room can be obtained through the [ZIMRoomJoinedCallback] callback.
  • Related APIs: You can create a room with [createRoom] and leave the room with [leaveRoom].
  • Available since: 1.1.0 or above.

Return

Callback of the result of joining the room

leaveRoom

leaveRoom
public void leaveRoom(const std::string & roomID, ZIMRoomLeftCallback callback)
Leave a room.
Declared in ZIM.h

Parameters

NameTypeDescription
roomIDconst std::string &ID of the room to leave.
callbackZIMRoomLeftCallbackCallback of the result of leave the room.

Details

When the user in the room needs to leave the room, use [leaveRoom] to leave the room. If the room does not exist, the leave fails.

  • Use cases: In the multi-person chat scenario, when users in the room need to leave the room, they can leave the room through this interface.
  • When to call: After creating a ZIM instance via [create], it can be called when the user is in the room.
  • Caution: If the current user is not in this room, the exit fails. When everyone leaves the room, the room will be automatically destroyed.
  • Related callbacks: The result of leaving the room can be obtained through the [ZIMRoomLeftCallback] callback.
  • Related APIs: You can create a room through [createRoom] and join a room with [joinRoom].
  • Available since: 1.1.0 or above.

Return

Callback of the result of leave the room.

leaveAllRoom

leaveAllRoom
public void leaveAllRoom(ZIMRoomAllLeftCallback callback)
Leave all rooms entered.
Declared in ZIM.h

Parameters

NameTypeDescription
callbackZIMRoomAllLeftCallbackLeave all rooms results callback.

Details

Call this interface to exit all rooms you have entered at once.

  • When to call: Can be called after logging in.
  • Related callbacks: Get the list of rooms left through the [ZIMRoomAllLeftCallback] callback.
  • Available since: 2.15 and above.

Return

Callback for the results of leaving all rooms.

queryRoomMemberList

queryRoomMemberList
public void queryRoomMemberList(const std::string& roomID, const ZIMRoomQueryMemberConfig & config, ZIMRoomMemberQueriedCallback callback)
Query the list of members in the room.
Declared in ZIM.h

Parameters

NameTypeDescription
roomIDconst std::string&ID of the room to query.
configconst ZIMRoomQueryMemberConfig &Configuration of query room member operation.
callbackZIMRoomMemberQueriedCallbackCallback for the result of querying room members list.

Details

After joining a room, you can use this function to get the list of members in the room.

  • Use cases: When a developer needs to obtain a list of room members for other business operations, this interface can be called to obtain a list of members.
  • When to call: After creating a ZIM instance through [create], and the user is in the room that needs to be queried, you can call this interface.
  • Caution: To use this feature, please contact ZEGOCLOUD technical support. If the user is not currently in this room, the query fails. When there are more than 500 room members, the result of querying the list of room members can only contain the information of a maximum of 500 members.
  • Related callbacks: Through the [ZIMRoomMemberQueriedCallback] callback, you can get the result of querying the room member list.
  • Related APIs: You can check the online number of people in the room through [queryRoomOnlineMemberCount].
  • Available since: 1.1.0 or above.

Return

Callback for the result of querying room members list.

queryRoomOnlineMemberCount

queryRoomOnlineMemberCount
public void queryRoomOnlineMemberCount(const std::string& roomID, ZIMRoomOnlineMemberCountQueriedCallback callback)
Query the number of online members in the room.
Declared in ZIM.h

Parameters

NameTypeDescription
roomIDconst std::string&ID of the room to query.
callbackZIMRoomOnlineMemberCountQueriedCallbackCallback for the result of querying room online members count.

Details

After joining a room, you can use this function to get the number of online members in the room.

  • Use cases: When a developer needs to obtain the number of room members who are online, this interface can be called.

Calling time: After creating a ZIM instance through [create], and the user is in the room that needs to be queried, this interface can be called.

  • Caution: If the user is not currently in this room, the query will fail.
  • Related callbacks: The result of querying the online number of room members can be obtained through the [ZIMRoomOnlineMemberCountQueriedCallback] callback.
  • Related APIs: the room member can be inquired through [queryRoomMember].
  • Available since: 1.1.0 or above.

Return

Callback for the result of querying room online members count.

queryRoomAllAttributes

queryRoomAllAttributes
public void queryRoomAllAttributes(const std::string& roomID, ZIMRoomAttributesQueriedCallback callback)
Query all properties of the room.
Declared in ZIM.h

Parameters

NameTypeDescription
roomIDconst std::string&Need to query the room number of the custom attributes.
callbackZIMRoomAttributesQueriedCallbackCallback for querying room attributes.

Details

Used to query room attributes.

  • Available since: 1.3.0.

Return

Callback for querying room attributes.

setRoomAttributes

setRoomAttributes
public void setRoomAttributes(std::unordered_map<std::string, std::string> & roomAttributes, const std::string& roomID, ZIMRoomAttributesSetConfig * config, ZIMRoomAttributesOperatedCallback callback)
Set room attributes (use this for all additions and changes).
Declared in ZIM.h

Parameters

NameTypeDescription
roomAttributesstd::unordered_map<std::string, std::string> &Room attributes to be set.
roomIDconst std::string&To modify the room number of the room attribute.
configZIMRoomAttributesSetConfig *Behavior configuration of the operation.
callbackZIMRoomAttributesOperatedCallbackOperation callback for setting room properties.

Details

Used to set room properties.

  • Use cases: This interface is used when you need to set the mic bit in a chat room.
  • When to call /Trigger: after login, and in the relevant room to call.
  • Default value: [ZIMRoomAttributesSetConfig] the space-time of the default configuration is optional, and do not update the owner, and involves the room properties in the owner is not automatically deleted after exit.
  • Privacy reminder: Try not to introduce sensitive information related to personal privacy into the property of the room, including but not limited to mobile phone number, ID number, passport number, real name, etc.

Privacy reminder: Adds or modifies room properties to an existing room.

  • Related callbacks: [ZIMRoomAttributesOperatedCallback].
  • Related APIs: [DeleteRoomAttributes] to delete room attributes. [QueryRoomAllAttributes], queries the room attributes.
  • Available since: 1.3.0.
  • Restrictions: You can set a maximum of 20 properties per room.

Notice: Key-value of the room property. The default key length is 16 and the default value length is 1024.

Return

Operation callback for setting room properties.

deleteRoomAttributes

deleteRoomAttributes
public void deleteRoomAttributes(std::vector<std::string> & keys, const std::string & roomID, ZIMRoomAttributesDeleteConfig * config, ZIMRoomAttributesOperatedCallback callback)
Delete room attributes.
Declared in ZIM.h

Parameters

NameTypeDescription
keysstd::vector<std::string> &The key of the room attribute to be deleted.
roomIDconst std::string &To modify the room number of the room attribute
configZIMRoomAttributesDeleteConfig *Behavior configuration of the operation.
callbackZIMRoomAttributesOperatedCallbackOperation callback for setting room properties.

Details

Used to delete room attributes.

  • Available since: 1.3.0.

Return

Operation callback for setting room properties.

beginRoomAttributesBatchOperation

beginRoomAttributesBatchOperation
public void beginRoomAttributesBatchOperation(const std::string& roomID, ZIMRoomAttributesBatchOperationConfig * config)
Open combination room attribute operation.
Declared in ZIM.h

Parameters

NameTypeDescription
roomIDconst std::string&The number of the room where the combined operation needs to be turned on.
configZIMRoomAttributesBatchOperationConfig *The configuration of the combined operation.

Details

Used to turn on the combination of room attributes.

  • Available since: 1.3.0.

endRoomAttributesBatchOperation

endRoomAttributesBatchOperation
public void endRoomAttributesBatchOperation(const std::string& roomID, ZIMRoomAttributesBatchOperatedCallback callback)
Complete the property operation of the combined room.
Declared in ZIM.h

Parameters

NameTypeDescription
roomIDconst std::string&To modify the room number of the room attribute.
callbackZIMRoomAttributesBatchOperatedCallbackCallback for combined operation.

Details

After completing the operation of combining room attributes, all the setting/deleting operations from the last call to beginRoomAttributesBatchOperation to this operation will be completed for the room.

  • Available since: 1.3.0.

Return

Callback for combined operation.

ZIMCacheConfig

Cache configuration

Details

Configure the storage path of cache files (such as chat records).

Declared in ZIMDefines.h

Properties

cachePath

cachePath
public std::string cachePath

The storage path of the cache files. Refer to the official website document for the default path.

ZIMCommandMessage

Custom binary message object.

Details

Identifies a binary message.

  • Caution: If the Type parameter of the base class is Custom during callback, you can force the base class message object to be of this type.

Declared in ZIMDefines.h

Properties

message

message
public std::vector<uint8_t> message

The content of the custom message.

type

type
public ZIMMessageType type

Identifies the type of this message.

messageID

messageID
public long long messageID

The unique ID that identifies this message.

  • Use cases: Can be used to index other messages.
  • Caution: When the developer actively creates a message, there is no need to modify this parameter. This parameter only has a value during callback.

timestamp

timestamp
public unsigned long long timestamp

Identifies the sending time of a message

  • Use cases: Used to present the sending time of a message, and can be used for message sorting.
  • Caution: This is a standard UNIX timestamp, in milliseconds.

senderUserID

senderUserID
public String senderUserID

Displays the userID of the sender of this message.

conversationID

conversationID
public String conversationID

Conversation ID. Ids of the same conversation type are unique.

direction

direction
public ZIMMessageDirection direction

Used to describe whether a message is sent or received.

sentStatus

sentStatus
public ZIMMessageSentStatus sentStatus

Describes the sending status of a message.

conversationType

conversationType
public ZIMConversationType conversationType

The type of conversation to which the message belongs.

conversationSeq

conversationSeq
public unsigned long long conversationSeq

Indicates the sequence number of the message in the conversation.

orderKey

orderKey
public long long orderKey

The larger the orderKey, the newer the message, and can be used for ordering messages.

localMessageID

localMessageID
public long long localMessageID

SDK locally generated MessageID, developers do not need to pay attention to.

isUserInserted

isUserInserted
public bool isUserInserted

Detail description: Describes whether the message is a message inserted by the developer through [insertMessageToLocalDB].

Default: false.

receiptStatus

receiptStatus
public ZIMMessageReceiptStatus receiptStatus

Describe the receipt status of the message

Business scenario: used to determine the status of the current message in the receipt message

extendedData

extendedData
public std::string extendedData

message extension field

  • Use cases: You can add extended fields to the message and send it to the peer
  • Required: no
  • Caution: the length is 1k, you can contact technical support for configuration
  • Available since: 2.6.0 or higher

localExtendedData

localExtendedData
public String localExtendedData

The expandable message field visible only on this end can store additional information locally, Through [updateMessageLocalExtendedData] change and currently has a length limit of 128K. If you have special requirements, please contact ZEGO technical support for configuration.

isBroadcastMessage

isBroadcastMessage
public bool isBroadcastMessage

Whether the message is pushed by all employees.

  • Required: Internal assignment.

isMentionAll

isMentionAll
public boolean isMentionAll

Whether to mention everyone. It can be presented as "@Everyone".

  • Use cases: For example, it can be used in groups or rooms.
  • Required: No.
  • Default value: false.
  • Recommended value: Set to true if you need to mention everyone.
  • Caution: This value does not add the "@Everyone" to the message text. Developers need to implement it themselves
  • Available since: 2.14.0 or above

mentionedUserIDs

mentionedUserIDs
public std::vector\<std::string> mentionedUserIDs

Whether to mention everyone. It can be presented as "@User".

  • Use cases: For example, it can be used in sending messages.
  • Required: No.
  • Caution: This value does not add the "@User" to the message text. Developers need to implement it themselves
  • Available since: 2.14.0 or above

messageSeq

messageSeq
public unsigned long long messageSeq

Indicates the sequence number of the message in the conversation.

rootRepliedCount

rootRepliedCount
public unsigned int rootRepliedCount

The number of reply messages corresponding to the root message of the reply message tree.

repliedInfo

repliedInfo
public ZIMMessageRepliedInfo repliedInfo

Information about the source message referenced by the reply message.

editorUserID

editorUserID
public std::string editorUserID

The latest editor's userID for this message.

editedTime

editedTime
public unsigned long long editedTime

The latest editing timestamp for this message.

isGroupTargetedMessage

isGroupTargetedMessage
public bool isGroupTargetedMessage

Identify if this message is group targeted message.

pinnedUserID

pinnedUserID
public std::string pinnedUserID

The last user who pinned this message.

  • Use cases: This parameter is only assigned in [queryPinnedMessageList] or [onMessagePinStatusChanged].

pinnedTime

pinnedTime
public long long pinnedTime

The last timestamp when pinned this message.

  • Use cases: This parameter is only assigned in [queryPinnedMessageList] or [onMessagePinStatusChanged].

Methods

ZIMCommandMessage

ZIMCommandMessage
Declared in ZIMDefines.h

ZIMConversation

Session specific content.

Details

The specific content of the session.

Declared in ZIMDefines.h

Properties

conversationID

conversationID
public std::string conversationID

conversationID.

conversationName

conversationName
public String conversationName

conversationName is the same as the groupName/userName value corresponding to the session.

type

type

conversation type.

unreadMessageCount

unreadMessageCount
public int unreadMessageCount

Session unread.

lastMessage

lastMessage
public ZIMMessage lastMessage

last message.

orderKey

orderKey
public long orderKey

OrderKey is used to describe the order of messages in the session. The larger orderKey is, the newer it is.

notificationStatus

notificationStatus
public ZIMConversationNotificationStatus notificationStatus

session notification status.

conversationAvatarUrl

conversationAvatarUrl
public std::string conversationAvatarUrl

Detail description: Conversation avatar URL. The peer to peer chat conversation avatar URL is the same as the user avatar URL, and the group chat conversation avatar URL is the same as the group avatar URL.

Use Limit: the maximum number of characters is 500 bytes. There is no limit on special characters.

isPinned

isPinned
public bool isPinned

Whether the conversation is pinned.

mentionedInfoList

mentionedInfoList
public std::vector<ZIMMessageMentionedInfo> mentionedInfoList

When reminded in a message or reminded to everyone in a conversation, this array will record the reminders.

  • Use cases: For example, you can display the number of reminders in the conversation list based on this array, and also display which user's reminder it is.

conversationAlias

conversationAlias
public String conversationAlias

After the friend remarks are set through [updateFriendAlias], this parameter is changed for each chat conversation. After setting a group alias by [updateGroupAlias], the corresponding group chat conversation's parameter will be modified synchronously.

  • Use cases: After update alias for friends or groups, the corresponding conversation chooses to display the alias over the conversation name when rendering the conversation page.

marks

marks
public std::vector\<int> marks

Describes all the existing marks for the conversation.

  • Use cases: The business layer can group logic, etc., according to different conversations with different marks.

draft

draft
public std::string draft

Conversation draft, when draft set conversation will carry this parameter.

ZIMConversationBaseInfo

Conversation base content.

Details

The base content of the session.

Declared in ZIMDefines.h

Properties

conversationID

conversationID
public std::string conversationID

conversationID.

conversationType

conversationType
public ZIMConversationType conversationType

conversation type.

ZIMConversationChangeInfo

Session change information.

Details

Contains information after session changes.

Declared in ZIMDefines.h

Properties

event

event

session events.

conversation

conversation
public std::shared_ptr<ZIMConversation> conversation

Session specific information.

ZIMConversationDeleteConfig

Delete session configuration.

Details

Delete the related configuration of the session.

Declared in ZIMDefines.h

Properties

isAlsoDeleteServerConversation

isAlsoDeleteServerConversation
public bool isAlsoDeleteServerConversation

Whether to delete the conversation on the server

  • Required: not required.
  • Default value: true.

ZIMConversationFilterOption

Search filters related to the conversation.

Details

Configurable filter options when querying conversation list.

Declared in ZIMDefines.h

Properties

marks

marks
public std::vector\<int> marks

Conversation marks. Only integers in the range [1, 20] are supported. If the list contains -1, the query result will be all marked conversation; if the list contains 0, the query result will be all unmarked conversations; if multiple markers are passed, the query result will be the union of all passed markers; if the list is empty, the query result will be all conversations.

  • Use cases: This filter can be used when needing to search for conversations that include specified conversation marks.

conversationTypes

conversationTypes
public std::vector<ZIMConversationType> conversationTypes

Conversation types. Only support one-on-one and group conversations.

  • Use cases: When you need to search by conversation type, you can use this filter.

isOnlyUnreadConversation

isOnlyUnreadConversation
public bool isOnlyUnreadConversation

Whether to only query conversations with unread counts. Pass true to only query conversations with unread counts. Pass false to query without considering whether conversations have unread counts.

  • Use cases: It is necessary to query conversations that have a message unread count.

ZIMConversationQueryConfig

Query the relevant configuration of the session.

Details

Configurable information when querying a session.

Declared in ZIMDefines.h

Properties

nextConversation

nextConversation
public std::shared_ptr<ZIMConversation> nextConversation

Session that needs to be queried.

  • Required: Not required.

count

count
public unsigned int count

The number of sessions to query.

  • Required: Required.

ZIMConversationTotalUnreadMessageCountQueryConfig

Search filters related to the conversation total unread message count.

Details

Configurable filter options when querying conversation total unread message count.

Declared in ZIMDefines.h

Properties

marks

marks
public std::vector\<int> marks

Conversation marks. Only integers in the range [1, 20] are supported. If the list contains -1, the query result will be all marked conversation; if the list contains 0, the query result will be all unmarked conversations; if multiple markers are passed, the query result will be the union of all passed markers; if the list is empty, the query result will be all conversations.

  • Use cases: This filter can be used when needing to search for conversations that include specified conversation marks.

conversationTypes

conversationTypes
public std::vector<ZIMConversationType> conversationTypes

Conversation types. Only support one-on-one and group conversations.

  • Use cases: When you need to search by conversation type, you can use this filter.

ZIMCustomMessage

Custom message object.

Details

Identifies a custom message.

  • Caution: When calling back, if the Type parameter of the base class is Custom, the base class message object can be forcibly converted to this class.
  • Available since: 2.8.0 and above.

Declared in ZIMDefines.h

Properties

message

message
public std::string message

The text content of the message.

subType

subType
public unsigned int subType

The subtype of the message, which is used by customers to customize the usage of different custom messages.

  • Required: The sender is required, otherwise the message will fail to be sent.

searchedContent

searchedContent
public std::string searchedContent

Search fields for custom messages. Since you cannot search for a custom message by directly searching the message field, you can concatenate the content you want to be searched in the custom message (such as the title of the poll, etc.) and put it in this parameter (the length is 64 bytes by default), so that follow-up search.

type

type
public ZIMMessageType type

Identifies the type of this message.

messageID

messageID
public long long messageID

The unique ID that identifies this message.

  • Use cases: Can be used to index other messages.
  • Caution: When the developer actively creates a message, there is no need to modify this parameter. This parameter only has a value during callback.

timestamp

timestamp
public unsigned long long timestamp

Identifies the sending time of a message

  • Use cases: Used to present the sending time of a message, and can be used for message sorting.
  • Caution: This is a standard UNIX timestamp, in milliseconds.

senderUserID

senderUserID
public String senderUserID

Displays the userID of the sender of this message.

conversationID

conversationID
public String conversationID

Conversation ID. Ids of the same conversation type are unique.

direction

direction
public ZIMMessageDirection direction

Used to describe whether a message is sent or received.

sentStatus

sentStatus
public ZIMMessageSentStatus sentStatus

Describes the sending status of a message.

conversationType

conversationType
public ZIMConversationType conversationType

The type of conversation to which the message belongs.

conversationSeq

conversationSeq
public unsigned long long conversationSeq

Indicates the sequence number of the message in the conversation.

orderKey

orderKey
public long long orderKey

The larger the orderKey, the newer the message, and can be used for ordering messages.

localMessageID

localMessageID
public long long localMessageID

SDK locally generated MessageID, developers do not need to pay attention to.

isUserInserted

isUserInserted
public bool isUserInserted

Detail description: Describes whether the message is a message inserted by the developer through [insertMessageToLocalDB].

Default: false.

receiptStatus

receiptStatus
public ZIMMessageReceiptStatus receiptStatus

Describe the receipt status of the message

Business scenario: used to determine the status of the current message in the receipt message

extendedData

extendedData
public std::string extendedData

message extension field

  • Use cases: You can add extended fields to the message and send it to the peer
  • Required: no
  • Caution: the length is 1k, you can contact technical support for configuration
  • Available since: 2.6.0 or higher

localExtendedData

localExtendedData
public String localExtendedData

The expandable message field visible only on this end can store additional information locally, Through [updateMessageLocalExtendedData] change and currently has a length limit of 128K. If you have special requirements, please contact ZEGO technical support for configuration.

isBroadcastMessage

isBroadcastMessage
public bool isBroadcastMessage

Whether the message is pushed by all employees.

  • Required: Internal assignment.

isMentionAll

isMentionAll
public boolean isMentionAll

Whether to mention everyone. It can be presented as "@Everyone".

  • Use cases: For example, it can be used in groups or rooms.
  • Required: No.
  • Default value: false.
  • Recommended value: Set to true if you need to mention everyone.
  • Caution: This value does not add the "@Everyone" to the message text. Developers need to implement it themselves
  • Available since: 2.14.0 or above

mentionedUserIDs

mentionedUserIDs
public std::vector\<std::string> mentionedUserIDs

Whether to mention everyone. It can be presented as "@User".

  • Use cases: For example, it can be used in sending messages.
  • Required: No.
  • Caution: This value does not add the "@User" to the message text. Developers need to implement it themselves
  • Available since: 2.14.0 or above

messageSeq

messageSeq
public unsigned long long messageSeq

Indicates the sequence number of the message in the conversation.

rootRepliedCount

rootRepliedCount
public unsigned int rootRepliedCount

The number of reply messages corresponding to the root message of the reply message tree.

repliedInfo

repliedInfo
public ZIMMessageRepliedInfo repliedInfo

Information about the source message referenced by the reply message.

editorUserID

editorUserID
public std::string editorUserID

The latest editor's userID for this message.

editedTime

editedTime
public unsigned long long editedTime

The latest editing timestamp for this message.

isGroupTargetedMessage

isGroupTargetedMessage
public bool isGroupTargetedMessage

Identify if this message is group targeted message.

pinnedUserID

pinnedUserID
public std::string pinnedUserID

The last user who pinned this message.

  • Use cases: This parameter is only assigned in [queryPinnedMessageList] or [onMessagePinStatusChanged].

pinnedTime

pinnedTime
public long long pinnedTime

The last timestamp when pinned this message.

  • Use cases: This parameter is only assigned in [queryPinnedMessageList] or [onMessagePinStatusChanged].

ZIMCustomMessageLiteInfo

Custom message lite info object.

Details

Identifies a custom message.

Declared in ZIMDefines.h

Properties

message

message
public std::string message

The text content of the message.

subType

subType
public unsigned int subType

The subtype of the message, which is used by customers to customize the usage of different custom messages.

  • Required: The sender is required, otherwise the message will fail to be sent.

searchedContent

searchedContent
public std::string searchedContent

Search fields for custom messages. Since you cannot search for a custom message by directly searching the message field, you can concatenate the content you want to be searched in the custom message (such as the title of the poll, etc.) and put it in this parameter (the length is 64 bytes by default), so that follow-up search.

type

type
public ZIMMessageType type

Identifies the type of this message.

ZIMError

Error infomation

Details

Error infomation.

Declared in ZIMDefines.h

Properties

code

code
public ZIMErrorCode code

The storage path of the log files. Refer to the official website document for the default path.

message

message
public std::string message

Error infomation description.

ZIMEventHandler

Details

Callback.

Declared in ZIMEventHandler.h

Methods

onBlacklistChanged

onBlacklistChanged
public void onBlacklistChanged(ZIM * zim, const std::vector<ZIMUserInfo> userList, ZIMBlacklistChangeAction action)
This method will be called back when the blacklist is updated or changes occur.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
userListconst std::vector<ZIMUserInfo>The collection of user information changes in the blacklist.
actionZIMBlacklistChangeActionWhen receiving changes to the blacklist, this value can be used to determine whether it's a deletion action or an addition action.
  • When to call: After creating a ZIM instance through [create].
  • Related APIs: [addUsersToBlacklist].

onFriendListChanged

onFriendListChanged
public void onFriendListChanged(ZIM * zim, const std::vector<ZIMFriendInfo> friendInfoList, ZIMFriendListChangeAction action)
This method will be called back when the friend list is updated or changes occur.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
friendInfoListconst std::vector<ZIMFriendInfo>The collection of user information changes in the friend list.
actionZIMFriendListChangeActionWhen receiving changes to the friend list, this value can be used to determine whether it's a deletion action or an addition action.
  • When to call: After creating a ZIM instance through [create].
  • Related APIs: [addFriend].

onFriendApplicationListChanged

onFriendApplicationListChanged
public void onFriendApplicationListChanged(ZIM * zim, const std::vector<ZIMFriendApplicationInfo> friendApplicationInfoList, ZIMFriendApplicationListChangeAction action)
This method will be called back when the friend application list changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
friendApplicationInfoListconst std::vector<ZIMFriendApplicationInfo>The data of the friend application list changes.
actionZIMFriendApplicationListChangeActionWhen receiving changes to the friend list, this value can be used to determine whether it's a deletion action or an addition action."
  • When to call: After creating a ZIM instance through [create].
  • Related APIs: [sendFriendApplication].

onFriendApplicationUpdated

onFriendApplicationUpdated
public void onFriendApplicationUpdated(ZIM * zim, const std::vector<ZIMFriendApplicationInfo> friendApplicationInfoList)
The current method will be called when there is an update in the friend request list.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
friendApplicationInfoListconst std::vector<ZIMFriendApplicationInfo>Data of the friend request list update.
  • When to call: After creating a ZIM instance through [create].
  • Related APIs: [acceptFriendApplication] [rejectFriendApplication]。

onFriendInfoUpdated

onFriendInfoUpdated
public void onFriendInfoUpdated(ZIM * zim, const std::vector<ZIMFriendInfo> friendInfoList)
This callback will be triggered when there is an update in the friend information.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
friendInfoListconst std::vector<ZIMFriendInfo>Data of friend information update.
  • When to call: After creating a ZIM instance through [create].
  • Related APIs: [updateFriendAlias] [updateFriendAttributes]。

onUserStatusUpdated

onUserStatusUpdated
public void onUserStatusUpdated(ZIM * zim, const std::vector<ZIMUserStatus>& userStatusList)
User status change notification.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *zim instance.
userStatusListconst std::vector<ZIMUserStatus>&A list with data about the user's online status.

Details

User online status change notification.

  • Use cases: This callback can be used when you needs to pay attention to the online status of certain users, for example, the online group members need to be displayed. After subscribing to users through the subscribeUsersStatus method, the online status of the targeted users and the changes of their online status during the validity period of the subscription will be notified to you through this callback.
  • When to call /Trigger: After the current user subscribes to the target user for the first time, the event will be triggered if the target user is added to the subscription list for the first time, or the subscribed user's online status or online platform list. In addition, the callback will also be triggered if the current user has opened a multi-terminal login and the online platform has changed.
  • Available since: 2.18.0
  • Restrictions: When the userStatusUpdated callback returns the userStatus information of the current user, the onlineStatus will be unknown and the lastUpdateTime will be 0, which cannot truly present the online status. Map the online status of the current user according to connectionStateChanged.

onError

onError
public void onError(ZIM * zim, ZIMError errorInfo)
The callback for error information.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
errorInfoZIMErrorError information, please refer to the error codes document.

Details

When an EXCEPTION occurs in the SDK, the callback prompts detailed exception information.

  • Use cases: It is recommended that developers listen for this callback notification and print the error information to the console during debugging after accessing the SDK, so that they can learn about the errors occurred during development and modify them in time.
  • When to call: When an error occurs within the SDK, the SDK notifies the developer through this function callback.
  • Available since: 1.1.0 or above.

onConnectionStateChanged

onConnectionStateChanged
public void onConnectionStateChanged(ZIM * zim, ZIMConnectionState state, ZIMConnectionEvent event, const std::string& extendedData)
The event callback when the connection state changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
stateZIMConnectionStateThe current connection state after changed.
eventZIMConnectionEventThe event that caused the connection state to change.
extendedDataconst std::string&Extra information when the event occurs, a standard JSON format data.

Details

When the connection status changes, the user will be notified of the current status and events through this callback.

  • Use cases: The [ZIMConnectionState] and [ZIMConnectionEvent] in this callback can be used to accomplish different business logic when you need to monitor the connection state and the events that cause the connection state to change.
  • When to call: This function is called back when connection state changes.
  • Available since: 1.1.0 or above.

onTokenWillExpire

onTokenWillExpire
public void onTokenWillExpire(ZIM * zim, unsigned int second)
A reminder callback that the token is about to expire.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
secondunsigned intThe remaining second before the token expires, the unit is seconds.

Details

When receiving this callback, the developer should call the [renewToken] function to update the Token in time.

  • Use cases: When the authentication Token has only 30 seconds left, the SDK calls back this function to notify the developer to update the authentication Token. If the validity period of the authentication Token passed by the developer when [login] is less than 30 seconds, the authentication Token will be recalled after [login] is successful.
  • When to call: For details, see authentication Token Generation https://doc-zh.zego.im/article/11617.
  • Available since: 1.1.0 or above.

onUserInfoUpdated

onUserInfoUpdated
public void onUserInfoUpdated(ZIM * zim, ZIMUserFullInfo info)
Callback for user information update.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
infoZIMUserFullInfoUpdated user information.

Details

In the multi-terminal login scenario, after the user modifies their information on device A, other online multi-terminal devices will receive this callback. For offline devices, after the user goes online, they need to call the [queryUsersInfo] interface to actively query user information.

  • Available since: 2.11.0 or above.

onUserRuleUpdated

onUserRuleUpdated
public void onUserRuleUpdated(ZIM * zim, ZIMSelfUserRule userRule)
Callback of user rule changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
userRuleZIMSelfUserRuleUpdated user rule information.

Details

Callback of user rule changes.

When to

  • Trigger: When the user rule of the current user is changed, all users are notified by the callback.
  • Available since: 2.15.0 and later versions.

onCallInvitationReceived

onCallInvitationReceived
public void onCallInvitationReceived(ZIM * zim, ZIMCallInvitationReceivedInfo info, const std::string & callID)
The notification callback for the call invitation received by the invitee.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
infoZIMCallInvitationReceivedInfoInformation about received call invitations.
callIDconst std::string &Received CallID.
  • When to call: After creating a ZIM instance through [create].

If the user is not in the invitation list or not online, this callback will not be called.

  • Related APIs: [callInvite].

onCallInvitationCreated

onCallInvitationCreated
public void onCallInvitationCreated(ZIM * zim, ZIMCallInvitationCreatedInfo info, const std::string & callID)
The notification callback for the call invitation created by the caller.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
infoZIMCallInvitationCreatedInfoInformation about created call invitations.
callIDconst std::string &Created CallID.
  • When to call: After creating a ZIM instance through [create].
  • Related APIs: [callInvite].

onCallInvitationCancelled

onCallInvitationCancelled
public void onCallInvitationCancelled(ZIM * zim, ZIMCallInvitationCancelledInfo info, std::string callID)
The notification callback received by the invitee to cancel the invitation.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
infoZIMCallInvitationCancelledInfoInformation about canceled call invitations.
callIDstd::stringCancelled callID.
  • When to call: After creating a ZIM instance through [create].

If the user is not in the cancel invitation list or is offline, this callback will not be called.

  • Related APIs: [callCancel].

onCallInvitationTimeout

onCallInvitationTimeout
public void onCallInvitationTimeout(ZIM * zim, ZIMCallInvitationTimeoutInfo info, std::string callID)
Callback for notification of called call invitation timeout.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
infoZIMCallInvitationTimeoutInfoInformation class about timeout notifications.
callIDstd::stringThe callID of the timeout.
  • When to call: After creating a ZIM instance through [create].

If the user is not on the invitation list or is not online, the callback will not be received.

  • Related APIs: [callInvite], [callAccept], [callReject].

onCallInvitationAccepted

onCallInvitationAccepted
deprecated
public void onCallInvitationAccepted(ZIM * zim, ZIMCallInvitationAcceptedInfo info, std::string callID)
The notification callback received by the inviter that invitee has accepted the invitation.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
infoZIMCallInvitationAcceptedInfoInformation about the call invitation.
callIDstd::stringThe accepted callID.
  • When to call: After creating a ZIM instance through [create].

This callback will not be called if the user is not online.

  • Related APIs: [callAccept].
Deprecated
This interface has been abandoned in ZIM 2.9.0. Please use [onCallUserStateChanged] instead.

onCallInvitationRejected

onCallInvitationRejected
deprecated
public void onCallInvitationRejected(ZIM * zim, ZIMCallInvitationAcceptedInfo info, std::string callID)
The inviter receives the notification callback that the invitee reject the invitation.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
infoZIMCallInvitationAcceptedInfoInformation about rejected call invitations.
callIDstd::stringThe callID of the rejected call invitation.

Details

This callback will be received when the inviter is online after the inviter rejects the call invitation.

  • Use cases: The inviter will receive this callback after the inviter declines the call invitation.
  • Default value: After creating a ZIM instance through [create] and logging in.
  • When to call /Trigger: After creating a ZIM instance through [create] and logging in.
  • Related APIs: [callReject].
  • Available since: 2.0.0 and above.
  • Restrictions: If the user is not the inviter of the call invitation or is not online, the callback will not be received.
Deprecated
This interface has been abandoned in ZIM 2.9.0. Please use [onCallUserStateChanged] instead.

onCallInviteesAnsweredTimeout

onCallInviteesAnsweredTimeout
deprecated
public void onCallInviteesAnsweredTimeout(ZIM * zim, std::vector\<std::string> invitees)
Callback for notification of caller call invitation timeout.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
inviteesstd::vector<std::string>Timeout invitee ID.
  • When to call: After creating a ZIM instance through [create].

If the user is not the inviter who initiated this call invitation or is not online, the callback will not be received.

  • Related APIs: [callInvite], [callAccept], [callReject].
Deprecated
This interface has been abandoned in ZIM 2.9.0. Please use [onCallUserStateChanged] instead.

onCallInvitationEnded

onCallInvitationEnded
public void onCallInvitationEnded(ZIM zim, const ZIMCallInvitationEndedInfo & info, const std::string & callID)
Callback for notification of caller call invitation ended.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infoconst ZIMCallInvitationEndedInfo &Information carried by the event callback.
callIDconst std::string &Timeout invitee ID.
  • Related APIs: [callEnd]

onCallUserStateChanged

onCallUserStateChanged
public void onCallUserStateChanged(ZIM * zim, const ZIMCallUserStateChangeInfo & info, std::vector\<std::string> callID)
Call the notification of the user status in the invitation invitation.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
infoconst ZIMCallUserStateChangeInfo &Information about the status change of a call member.
callIDstd::vector<std::string>Unique identifier of the call.
  • When to call: When a new member is invited to a call, or a member accepts, rejects, exits, or a member response times out, all users on the current call invitation whose status is "Inviting," "Accepted," and "Received" receive the callback here. If the member is not online at the time of notification, the call is still ongoing when the login succeeds. The status changes of all members during the offline period will be sent to the user at one time.

If the user is not the inviter who initiated this call invitation or is not online, the callback will not be received.

  • Related APIs: [callInvite], [callingInvite], [callAccept], [callReject],[callQuit].

onGroupStateChanged

onGroupStateChanged
public void onGroupStateChanged(ZIM * zim, ZIMGroupState state, ZIMGroupEvent event, ZIMGroupOperatedInfo operatedInfo, ZIMGroupFullInfo groupInfo)
Group state change notification callback.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
stateZIMGroupStateThe status of the group after the change.
eventZIMGroupEventGroup related events.
operatedInfoZIMGroupOperatedInfoGroup information that has been operated.
groupInfoZIMGroupFullInfoInformation about group status changes.

Details

allback notification of group status change.

  • Use cases: Scenarios that require interaction based on the group status.
  • When to call /Trigger: A notification is triggered when a group is created, joined, left, or dismissed.
  • Related APIs: [createGroup] : creates a group. [joinGroup] : joins a group. [leaveGroup], leave the group. [dismissGroup]; dismiss the group.

onGroupAliasUpdated

onGroupAliasUpdated
public void onGroupAliasUpdated(ZIM * zim, const std::string& groupAlias, const std::string& operatedUserID, const std::string& groupID)
Group alias update notification callback.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
groupAliasconst std::string&The updated group alias.
operatedUserIDconst std::string&The userID of who modifies the group alias.
groupIDconst std::string&The target group ID.

Details

Group alias change notification callback.

  • Use cases: When the group alias is changed, this notification synchronizes the latest group alias to all devices of the user who made the modification.

When to

  • Trigger: The group alias is changed.
  • Related APIs: [updateGroupAlias].

onGroupNameUpdated

onGroupNameUpdated
public void onGroupNameUpdated(ZIM * zim, const std::string& groupName, ZIMGroupOperatedInfo operatedInfo, const std::string& groupID)
Group name update notification callback.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
groupNameconst std::string&The updated group name.
operatedInfoZIMGroupOperatedInfoOperation information after the group name is updated.
groupIDconst std::string&The groupID where the group name update occurred.

Details

Group name change notification callback.

  • Use cases: If the group name is changed, you need to synchronize the latest group name.
  • When to call /Trigger: The group name is changed. Procedure
  • Related APIs: [updateGroupName] : updates the group name.

onGroupAvatarUrlUpdated

onGroupAvatarUrlUpdated
public void onGroupAvatarUrlUpdated(ZIM * zim, const std::string & groupAvatarUrl, ZIMGroupOperatedInfo operatedInfo, const std::string & groupID)
Group avatar URL update notification callback.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
groupAvatarUrlconst std::string &The updated group avatar URL.
operatedInfoZIMGroupOperatedInfoThe operation information after the group avatar URL is updated.
groupIDconst std::string &The groupID where the group name update occurred.
  • Related APIs: [updateGroupAvatarUrl], update group avatar URL.

onGroupNoticeUpdated

onGroupNoticeUpdated
public void onGroupNoticeUpdated(ZIM * zim, const std::string& groupNotice, const std::string& operatedInfo, const std::string & groupID)
Notification callback for group announcement updates.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
groupNoticeconst std::string&Updated group announcement.
operatedInfoconst std::string&The group announces the updated operation information.
groupIDconst std::string &The groupID where the group announcement update occurred.

Details

Group bulletin Change notification callback.

  • Use cases: If a group bulletin changes, you need to synchronize the latest bulletin content.
  • When to call /Trigger: The group bulletin is changed. Procedure
  • Related APIs: [updateGroupNotice], which updates the group notice.

onGroupMutedInfoUpdated

onGroupMutedInfoUpdated
public void onGroupMutedInfoUpdated(ZIM * zim, ZIMGroupMuteInfo muteInfo, const std::string& operatedInfo, const std::string & groupID)
Notification callback for group mute info updates.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
muteInfoZIMGroupMuteInfoGroup mute info.
operatedInfoconst std::string&Operation information for changes in group mute.
groupIDconst std::string &The groupID where the group mute change occurred.

Details

Callback notification for changes in group mute information.

  • Use cases: To know the details of changes when group mute information changes.

When to trigger: When group mute information changes.

  • Related APIs: [muteGroup], Group Mute.

onGroupVerifyInfoUpdated

onGroupVerifyInfoUpdated
public void onGroupVerifyInfoUpdated(ZIM * zim, ZIMGroupVerifyInfo verifyInfo, ZIMGroupOperatedInfo * operatedInfo, const std::string & groupID)
Notification callback for group verification mode update.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
verifyInfoZIMGroupVerifyInfoGroup verification mode info.
operatedInfoZIMGroupOperatedInfo *Operation information for changes in group verification mode.
groupIDconst std::string &The groupID where the group verification mode change occurred.

Details

Callback notification for changes in group verification mode.

When to trigger: When group verification mode changes.

  • Related APIs: [updateGroupJoinMode, updateGroupInviteMode, updateGroupBeInviteMode], Update the group verification mode.

onGroupAttributesUpdated

onGroupAttributesUpdated
public void onGroupAttributesUpdated(ZIM * zim, std::vector<ZIMGroupAttributesUpdateInfo> infos, ZIMGroupOperatedInfo operatedInfo, const std::string& groupID)
Group property update attributes callback.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
infosstd::vector<ZIMGroupAttributesUpdateInfo>Information after group attribute update.
operatedInfoZIMGroupOperatedInfoOperation information after the group attribute is updated.
groupIDconst std::string&The groupID for sending group attribute updates.

Details

Group attribute change notification callback.

  • Use cases: When group attributes are changed, you need to synchronize the latest group attributes.
  • When to call /Trigger: Triggered when group properties are set, updated, or deleted.
  • Related APIs: [setGroupAttributes] updates group attributes. [deleteGroupAttributes], delete the group attribute.

onGroupMemberStateChanged

onGroupMemberStateChanged
public void onGroupMemberStateChanged(ZIM * zim, ZIMGroupMemberState state, ZIMGroupMemberEvent event, std::vector<ZIMGroupMemberInfo> userList, ZIMGroupOperatedInfo operatedInfo, const std::string& groupID)
Group member state change notification callback.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
stateZIMGroupMemberStateUpdated membership status.
eventZIMGroupMemberEventUpdated member events.
userListstd::vector<ZIMGroupMemberInfo>Updated member information.
operatedInfoZIMGroupOperatedInfoUpdated operational information.
groupIDconst std::string&The groupID where the member state change occurred.

Details

Group member status change notification callback.

  • Use cases: Scenarios that require interaction based on group member states.
  • When to call /Trigger: Notification is triggered when a group is created, joined, left, or dismissed, or a user is invited to join or kicked out of the group.
  • Related APIs: [createGroup], creates a group. [joinGroup], joins a group. [leaveGroup], leave the group. [dismissGroup], dismiss the group. [intiveUsersIntoGroup], which invites users to join the group. [kickGroupMembers], kicks the user out of the group.

onGroupMemberInfoUpdated

onGroupMemberInfoUpdated
public void onGroupMemberInfoUpdated(ZIM * zim, ArrayList<ZIMGroupMemberInfo> groupMemberInfos, ZIMGroupOperatedInfo operatedInfo, const std::string& groupID)
Group member basic information change notification.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
groupMemberInfosArrayList<ZIMGroupMemberInfo>Updated member information.
operatedInfoZIMGroupOperatedInfoUpdated operational information.
groupIDconst std::string&The groupID where the group member information has been changed.

Details

Return the operation result of changing group member information.

  • Use cases: After the basic information of group members is changed, you need to display or interact with group members on the page.
  • When to call /Trigger: The result is displayed after the group member information is changed.
  • Related APIs: [setGroupMemberNickname], updates the nickname of a group member. [setGroupMemberRole], updates the group member role. [transferGroupOwner], group master transfer.

onGroupApplicationListChanged

onGroupApplicationListChanged
public void onGroupApplicationListChanged(ZIM * zim, const std::vector<ZIMGroupApplicationInfo> applicationList, ZIMGroupApplicationListChangeAction action)
This method will be called back when the group application list changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
applicationListconst std::vector<ZIMGroupApplicationInfo>The data of the group application list changes.
actionZIMGroupApplicationListChangeActionWhen receiving changes to the group application list, this value can be used to determine whether it's a deletion action or an addition action."
  • When to call: After creating a ZIM instance through [create].
  • Related APIs: [sendGroupJoinApplication], [sendGroupInviteApplications].

onGroupApplicationUpdated

onGroupApplicationUpdated
public void onGroupApplicationUpdated(ZIM * zim, const std::vector<ZIMGroupApplicationInfo> applicationList)
This method will be called back when the group application list changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
applicationListconst std::vector<ZIMGroupApplicationInfo>The data of the group application list changes.
  • When to call: After creating a ZIM instance through [create].
  • Related APIs: [acceptGroupJoinApplication], [rejectGroupJoinApplication], [acceptGroupInviteApplication], [rejectGroupInviteApplication].

onConversationChanged

onConversationChanged
public void onConversationChanged(ZIM * zim, std::vector<ZIMConversationChangeInfo> conversationChangeInfoList)
Received notification callback for session update.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
conversationChangeInfoListstd::vector<ZIMConversationChangeInfo>Changed information about the conversation.

Details

Trigger this callback to return notification of session updates when a session is added, deleted, modified, pinned or unpinned.

  • When to call /Trigger: Notifications are triggered when a new message is updated in the session, or when the session itself is added, deleted, or modified.
  • Caution: ConversationID is the same as single chat toUserID and group chat GroupID.
  • Related APIs: Triggered by [sendPeerMessage], [sendGroupMessage], [sendRoomMessage], [deleteConversation], [deleteMessage], [deleteMessageByConversationID], [updateConversationPinnedState].
  • Available since: 2.0.0 and above.

onConversationMessageReceiptChanged

onConversationMessageReceiptChanged
public void onConversationMessageReceiptChanged(ZIM * zim, std::vector<ZIMMessageReceiptInfo> infos)
Callback for notifications of read updates for sessions that receive receipts.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
infosstd::vector<ZIMMessageReceiptInfo>Receipt information.

Details

When the message receiver has read the session, the message sender knows through this callback.

  • Trigger: Trigger a notification when the message receiver has read the session.
  • Related APIs: triggered when the peer calls via [sendConversationMessageReceiptRead].
  • Available since: 2.5.0 and above.

onConversationSyncStateChanged

onConversationSyncStateChanged
public void onConversationSyncStateChanged(ZIM * zim, ZIMConversationSyncState state)
Received notification callback for synchronizing conv list from server.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
stateZIMConversationSyncStateThe synchronizing conversation list state from server.

Details

This callback is triggered to notify of conversation updates when the SDK initiates the process of synchronizing conversations from the server after initial login, and when the process completes or fails.

When to

  • Trigger: The notification is triggered when the SDK confirms the need to pull list data from the server.
  • Caution: ConversationID is the same as single chat toUserID and group chat GroupID.
  • Available since: 2.21.0 and above.

onConversationsAllDeleted

onConversationsAllDeleted
public void onConversationsAllDeleted(ZIM * zim, ZIMConversationsAllDeletedInfo info)
The callback of all conversation deletion was received.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
infoZIMConversationsAllDeletedInfoInfo about all conversations be deleted.

Details

When multiple login ends delete all conversations, the local end triggers the callback to notify the local end that all conversations are deleted.

  • When to call /Trigger: When another end clears all unread conversations, the local end triggers a notification.
  • Related APIs: Triggered by [deleteAllConversations] .
  • Available since: 2.12.0 and above.

onMessageReceiptChanged

onMessageReceiptChanged
public void onMessageReceiptChanged(ZIM * zim, std::vector<ZIMMessageReceiptInfo> infos)
The notification callback for the read update of the message that received the receipt.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
infosstd::vector<ZIMMessageReceiptInfo>Receipt information.

Details

When the message receiver confirms that the message has been read, the message sender knows through this callback.

  • Trigger: Trigger a notification when the message receiver has read the message.
  • Related APIs: triggered when the peer calls via [sendMessageReceiptsRead].
  • Available since: 2.5.0 and above.

onConversationTotalUnreadMessageCountUpdated

onConversationTotalUnreadMessageCountUpdated
public void onConversationTotalUnreadMessageCountUpdated(ZIM * zim, unsigned int totalUnreadMessageCount)
Notification callback for session total unread updates.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
totalUnreadMessageCountunsigned intUpdated total unreads.

Details

This callback is used to return the total unread of the session.

  • When to call /Trigger: Log in, call [deleteConversation], [deleteMessage], [deleteAllMessageByConversationID], [clearConversationUnreadMessageCount], [clearConversationTotalUnreadMessageCount] Causes the message reading to change to trigger the callback.
  • Related APIs: [deleteConversation]、[deleteMessage]、[deleteMessageByConversationID]、[clearConversationUnreadMessageCount]、[clearConversationTotalUnreadMessageCount]
  • Available since: 2.0.0 and above.

onGroupMessageReceived

onGroupMessageReceived
public void onGroupMessageReceived(ZIM * zim, const std::vector<std::shared_ptr<ZIMMessage>> & messageList, const ZIMMessageReceivedInfo & info, const std::string & fromGroupID)
The callback for receiving group message.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
messageListconst std::vector<std::shared_ptr<ZIMMessage>> &List of received messages.
infoconst ZIMMessageReceivedInfo &Message Receiving information about the event.
fromGroupIDconst std::string &ID of the group that received the message.

Details

When the user is online, they can receive online group messages through this callback. Also, when the user logs back into the ZIM SDK, they can receive all the group chat messages received during the offline period (up to 7 days) through this callback.

Call timing: This callback occurs when a ZIM instance is created with [create] and a group member sends a message.

  • Related callbacks: You can send messages to other group members via [sendGroupMessage].
  • Available since: 2.18.0 or above

onPeerMessageReceived

onPeerMessageReceived
public void onPeerMessageReceived(ZIM * zim, const std::vector<std::shared_ptr<ZIMMessage>> & messageList, const ZIMMessageReceivedInfo& info, const std::string & fromUserID)
The callback for receiving peer-to-peer message.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
messageListconst std::vector<std::shared_ptr<ZIMMessage>> &List of received messages.
infoconst ZIMMessageReceivedInfo&Receive information about the message event.
fromUserIDconst std::string &The unique identifier of the message sender.

Details

When the user is online, they can receive one-on-one chat messages through this callback. Also, when the user logs back into the ZIM SDK, they can receive all the one-on-one chat messages received during the offline period (up to 7 days) through this callback.

Call timing: This callback occurs when a ZIM instance is created with [create] and the other user sends you a message.

  • Related callbacks: You can send messages to other members via [sendPeerMessage].
  • Available since: 2.18.0 or above

onRoomMessageReceived

onRoomMessageReceived
public void onRoomMessageReceived(ZIM * zim, const std::vector<std::shared_ptr<ZIMMessage>> & messageList, const ZIMMessageReceivedInfo & info, const std::string & fromRoomID)
The callback for receiving room message.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
messageListconst std::vector<std::shared_ptr<ZIMMessage>> &List of received messages.
infoconst ZIMMessageReceivedInfo &Message receiving the information carried by the event.
fromRoomIDconst std::string &ID of the room chat that received the message.

Details

When the user is online, they can receive online room messages through this callback. Also, when the user transitions back to online status from being offline, if they are still in the room, they can receive all the room messages received during the offline period through this callback.

Call timing: This callback occurs when a ZIM instance is created with [create] and a group member sends a message.

  • Related callbacks: You can send messages to other group members via [sendRoomMessage].
  • Available since: 2.18.0 or above

onMessageEdited

onMessageEdited
public void onMessageEdited(ZIM * zim, const std::vector<std::shared_ptr<ZIMMessage>> & messageList)
The callback for receiving edited message.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
messageListconst std::vector<std::shared_ptr<ZIMMessage>> &List of received messages.

Details

This callback is received when some one edited a message.

Call timing: This callback occurs when a ZIM instance is created with [create] and the other user edited a message.

  • Related callbacks: You can edit the message sent successfully by yourself through [editMessage].
  • Available since: 2.20.0 or above.

onMessagePinStatusChanged

onMessagePinStatusChanged
public void onMessagePinStatusChanged(ZIM * zim, const std::vector<ZIMMessagePinStatusChangeInfo> & changeInfoList)
The notification for receiving message pinned status changed.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
changeInfoListconst std::vector<ZIMMessagePinStatusChangeInfo> &List of received messages pinned status changed info list.

Details

This notification is received when a message successfully is pinned or unpinned.

Call timing: This callback occurs after a ZIM instance is created with [create] and another user successfully pins or unpins a message.

  • Related APIs: You can pin or unpin a message you successfully sent yourself through [pinMessage].

onMessageRevokeReceived

onMessageRevokeReceived
public void onMessageRevokeReceived(ZIM * zim, const std::vector<std::shared_ptr<ZIMMessage>> & messageList)
The callback for receiving revoke message.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
messageListconst std::vector<std::shared_ptr<ZIMMessage>> &List of received messages.

Details

This callback is received when some one else sends a message and then revoke.

Call timing: This callback occurs when a ZIM instance is created with [create] and the other user revoke a message.

  • Related callbacks: You can revoke message to other members via [revokeMessage].
  • Available since: 2.5.0 or above.

onMessageSentStatusChanged

onMessageSentStatusChanged
public void onMessageSentStatusChanged(ZIM * zim, const std::vector<std::shared_ptr<ZIMMessageSentStatusChangeInfo>> & infos)
The callback for received message send status change.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
infosconst std::vector<std::shared_ptr<ZIMMessageSentStatusChangeInfo>> &List of received messages.

Details

This callback is received when messages status changed.

Call timing: This callback occurs when messages status changed.

  • Related callbacks: You can send message to other members via [sendMessage].
  • Available since: 2.6.0 or above.

onBroadcastMessageReceived

onBroadcastMessageReceived
public void onBroadcastMessageReceived(ZIM * zim, const std::shared_ptr<ZIMMessage> & message)
The callback of the broadcast message received by all employees.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
messageconst std::shared_ptr<ZIMMessage> &Received message.

Details

The callback is received when the server interface [SendMessageToAllUsers] sends a message.

Call time: This callback is received after logging in to the ZIM service and the server call the [SendMessageToAllUsers] interface to send a message.

onMessageReactionsChanged

onMessageReactionsChanged
public void onMessageReactionsChanged(ZIM * zim, std::vector<ZIMMessageReaction> reactions)
The callback of the reactions change.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
reactionsstd::vector<ZIMMessageReaction>The list of changed reactions.

Details

The callback is received when reactions change

When to Call: This callback can be registered after the ZIM instance is created by [create] and before login.

When to

  • Trigger: After other users add or delete reactions to messages in private or group chats.
  • Related APIs: [addMessageReaction]、[deleteMessageReaction]

onMessageDeleted

onMessageDeleted
public void onMessageDeleted(ZIM * zim, ZIMMessageDeletedInfo deletedInfo)
Callback when the message is deleted.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
deletedInfoZIMMessageDeletedInfoDeleted message information.

Details

In the multi-terminal login scenario, after the user deletes the server level message on device A, other online multi-terminal devices will receive this callback..

onReceivePeerMessage

onReceivePeerMessage
deprecated
public void onReceivePeerMessage(ZIM * zim, const std::vector<std::shared_ptr<ZIMMessage>> & messageList, const std::string & fromUserID)
The callback for receiving peer-to-peer message.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
messageListconst std::vector<std::shared_ptr<ZIMMessage>> &List of received messages.
fromUserIDconst std::string &The user ID of the message sender.The same as the peer-chat conversation ID.

Details

This callback is received when you receive a point-to-point message from someone else.

Call timing: This callback occurs when a ZIM instance is created with [create] and the other user sends you a message.

  • Related callbacks: You can send messages to other members via [sendPeerMessage].
  • Available since: 2.0.0 or above
Deprecated
This method is deprecated in version 2.18.0, please use [onPeerMessageReceived] instead.

onReceiveRoomMessage

onReceiveRoomMessage
deprecated
public void onReceiveRoomMessage(ZIM * zim, const std::vector<std::shared_ptr<ZIMMessage>> & messageList, const std::string & fromRoomID)
The callback for receiving room message.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
messageListconst std::vector<std::shared_ptr<ZIMMessage>> &List of received messages.
fromRoomIDconst std::string &ID of the room where the message was received.

Details

This callback is received when an in-room message is received.

Call timing: This callback occurs when a ZIM instance is created with [create] and a group member sends a message.

  • Related callbacks: You can send messages to other group members via [sendRoomMessage].
  • Available since: 2.0.0 or above
Deprecated
This method is deprecated in version 2.18.0, please use [onRoomMessageReceived] instead.

onMessageRepliedCountChanged

onMessageRepliedCountChanged
public void onMessageRepliedCountChanged(ZIM * zim, const std::vector<std::shared_ptr< ZIMMessageRootRepliedCountInfo>> & infos)
Reply to the event that the number of message trees has changed.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
infosconst std::vector<std::shared_ptr< ZIMMessageRootRepliedCountInfo>> &A list of the number of replies to the root message.

Details

When there is a new reply message, the number of replies to the corresponding root message is notified through this event.

  • Available since: 2.17.0 or above

onMessageRepliedInfoChanged

onMessageRepliedInfoChanged
public void onMessageRepliedInfoChanged(ZIM * zim, const std::vector<std::shared_ptr<ZIMMessage>> & messageList)
The reply information of a reply message is changed.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
messageListconst std::vector<std::shared_ptr<ZIMMessage>> &List of received messages.

Details

Change event for a reply message received after the source message referenced by the reply message is deleted and withdrawn.

  • Available since: 2.17.0 or above

onReceiveGroupMessage

onReceiveGroupMessage
deprecated
public void onReceiveGroupMessage(ZIM * zim, const std::vector<std::shared_ptr<ZIMMessage>> & messageList, const std::string & fromGroupID)
The callback for receiving group message.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
messageListconst std::vector<std::shared_ptr<ZIMMessage>> &List of received messages.
fromGroupIDconst std::string &The group ID of the message sender.

Details

This callback is received when a group message is received.

Call timing: This callback occurs when a ZIM instance is created with [create] and a group member sends a message.

  • Related callbacks: You can send messages to other group members via [sendGroupMessage].
  • Available since: 2.0.0 or above
Deprecated
This method is deprecated in version 2.18.0, please use [onGroupMessageReceived] instead.

onRoomStateChanged

onRoomStateChanged
public void onRoomStateChanged(ZIM * zim, ZIMRoomState state, ZIMRoomEvent event, const std::string& extendedData, const std::string& roomID)
event callback when the room connection status changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
stateZIMRoomStateThe current room connection state after changed.
eventZIMRoomEventThe event that caused the room connection state to change.
extendedDataconst std::string&Extra information when the event occurs, a standard JSON string.
roomIDconst std::string&ID of the room where the status changed

Details

event callback when the room connection status changes.

  • When to call:
    creating a ZIM instance through [create], you can call this interface.
  • Related APIs: through [onTokenWillExpire], the callback will be received when the token is about to expire.
  • Available since: 1.1.0 or above.

onRoomMemberJoined

onRoomMemberJoined
public void onRoomMemberJoined(ZIM * zim, const std::vector<ZIMUserInfo> & memberList, const std::string& roomID)
Callback when other members join the room.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
memberListconst std::vector<ZIMUserInfo> &List of members who joined the room.
roomIDconst std::string&The ID of the room where this event occurred.

Details

After joining a room, when other members also join this room, they will receive this callback.

  • Use cases: When other members in the room join, this callback will be called.
  • When to call: After creating a ZIM instance through [create], and the user is in a room joined by other members, you can call this interface.
  • Caution: If the user is not currently in this room, this callback will not be called.
  • Related APIs: You can use [onRoomMemberLeft] to receive this callback when other room members leave.
  • Available since: 1.1.0 or above.

onRoomMemberLeft

onRoomMemberLeft
public void onRoomMemberLeft(ZIM * zim, const std::vector<ZIMUserInfo> & memberList, const std::string & roomID)
Callback when other members leave the room.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
memberListconst std::vector<ZIMUserInfo> &List of members who left the room.
roomIDconst std::string &The ID of the room where this event occurred.

Details

After joining a room, when other members leave the room, they will receive this callback.

  • Use cases: When other members in the room leave the room, this callback will be called.
  • When to call: After creating a ZIM instance through [create], and the user is in the same room of other members, you can call this interface.
  • Caution: If the user is not currently in this room, this callback will not be called.
  • Related APIs: You can receive this callback when other room members join through [onRoomMemberJoined].
  • Available since: 1.1.0 or above.

onRoomAttributesUpdated

onRoomAttributesUpdated
public void onRoomAttributesUpdated(ZIM * zim, ZIMRoomAttributesUpdateInfo info, std::string roomID)
Notification of room property changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *
infoZIMRoomAttributesUpdateInfo
roomIDstd::string

Details

When the room attribute in the room changes, it will be notified through this callback.

  • Available since: 1.3.0.

onRoomAttributesBatchUpdated

onRoomAttributesBatchUpdated
public void onRoomAttributesBatchUpdated(ZIM * zim, std::string roomID, std::vector<ZIMRoomAttributesUpdateInfo> infos)
Notification of room property changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *
roomIDstd::string
infosstd::vector<ZIMRoomAttributesUpdateInfo>

Details

When the room attribute in the room changes, it will be notified through this callback.

  • Available since: 1.3.0.

onRoomMemberAttributesUpdated

onRoomMemberAttributesUpdated
public void onRoomMemberAttributesUpdated(ZIM * zim, const std::vector<ZIMRoomMemberAttributesUpdateInfo> & infos, ZIMRoomOperatedInfo operatedInfo, std::string roomID)
Room user property update callback.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIM *ZIM instance.
infosconst std::vector<ZIMRoomMemberAttributesUpdateInfo> &The infos of the room member attributes changed.
operatedInfoZIMRoomOperatedInfoRoom operation information.
roomIDstd::stringRoom ID.

Details

Details: This callback will be received when a user's property in the room is changed.

ZIMLogConfig

Log configuration

Details

Configure the storage path of log files and the maximum log file size.

Declared in ZIMDefines.h

Properties

logPath

logPath
public std::string logPath

The storage path of the log files. Refer to the official website document for the default path.

logSize

logSize
public unsigned long long logSize

The maximum log file size (Bytes). The default maximum size is 5MB (5 * 1024 * 1024 Bytes)

ZIMMediaMessageSendNotification

The notification callback when the media message is sent, you can get the relevant information before the message object is sent through this notification

Details

Detailed description: Through this notification, developers can obtain relevant information before the message object is sent, such as localMessageID, etc.

Business scenario: When developers need to record and cache relevant information before sending a message, they can obtain it by listening to the notification.

If no monitoring is required, it can be passed null.

Declared in ZIMDefines.h

Properties

onMessageAttached

onMessageAttached
public ZIMMessageAttachedCallback onMessageAttached
  • Required: not required. If no monitoring is required, it can be passed empty.

Default: empty.

onMediaUploadingProgress

onMediaUploadingProgress
public ZIMMediaUploadingProgress onMediaUploadingProgress
  • Required: not required. If no monitoring is required, it can be passed empty.

Default: empty.

ZIMMessage

Base class of message object

Details

Identifies the basic parameters of a message.

  • Caution: Some of the parameters, such as Message ID, only have values ​​during the callback. Developers do not need to assign values ​​to these parameters when they actively create this object for sending messages.

Declared in ZIMDefines.h

Properties

type

type
public ZIMMessageType type

Identifies the type of this message.

messageID

messageID
public long long messageID

The unique ID that identifies this message.

  • Use cases: Can be used to index other messages.
  • Caution: When the developer actively creates a message, there is no need to modify this parameter. This parameter only has a value during callback.

timestamp

timestamp
public unsigned long long timestamp

Identifies the sending time of a message

  • Use cases: Used to present the sending time of a message, and can be used for message sorting.
  • Caution: This is a standard UNIX timestamp, in milliseconds.

senderUserID

senderUserID
public String senderUserID

Displays the userID of the sender of this message.

conversationID

conversationID
public String conversationID

Conversation ID. Ids of the same conversation type are unique.

direction

direction
public ZIMMessageDirection direction

Used to describe whether a message is sent or received.

sentStatus

sentStatus
public ZIMMessageSentStatus sentStatus

Describes the sending status of a message.

conversationType

conversationType
public ZIMConversationType conversationType

The type of conversation to which the message belongs.

conversationSeq

conversationSeq
public unsigned long long conversationSeq

Indicates the sequence number of the message in the conversation.

orderKey

orderKey
public long long orderKey

The larger the orderKey, the newer the message, and can be used for ordering messages.

localMessageID

localMessageID
public long long localMessageID

SDK locally generated MessageID, developers do not need to pay attention to.

isUserInserted

isUserInserted
public bool isUserInserted

Detail description: Describes whether the message is a message inserted by the developer through [insertMessageToLocalDB].

Default: false.

receiptStatus

receiptStatus
public ZIMMessageReceiptStatus receiptStatus

Describe the receipt status of the message

Business scenario: used to determine the status of the current message in the receipt message

extendedData

extendedData
public std::string extendedData

message extension field

  • Use cases: You can add extended fields to the message and send it to the peer
  • Required: no
  • Caution: the length is 1k, you can contact technical support for configuration
  • Available since: 2.6.0 or higher

localExtendedData

localExtendedData
public String localExtendedData

The expandable message field visible only on this end can store additional information locally, Through [updateMessageLocalExtendedData] change and currently has a length limit of 128K. If you have special requirements, please contact ZEGO technical support for configuration.

isBroadcastMessage

isBroadcastMessage
public bool isBroadcastMessage

Whether the message is pushed by all employees.

  • Required: Internal assignment.

isMentionAll

isMentionAll
public boolean isMentionAll

Whether to mention everyone. It can be presented as "@Everyone".

  • Use cases: For example, it can be used in groups or rooms.
  • Required: No.
  • Default value: false.
  • Recommended value: Set to true if you need to mention everyone.
  • Caution: This value does not add the "@Everyone" to the message text. Developers need to implement it themselves
  • Available since: 2.14.0 or above

mentionedUserIDs

mentionedUserIDs
public std::vector\<std::string> mentionedUserIDs

Whether to mention everyone. It can be presented as "@User".

  • Use cases: For example, it can be used in sending messages.
  • Required: No.
  • Caution: This value does not add the "@User" to the message text. Developers need to implement it themselves
  • Available since: 2.14.0 or above

messageSeq

messageSeq
public unsigned long long messageSeq

Indicates the sequence number of the message in the conversation.

rootRepliedCount

rootRepliedCount
public unsigned int rootRepliedCount

The number of reply messages corresponding to the root message of the reply message tree.

repliedInfo

repliedInfo
public ZIMMessageRepliedInfo repliedInfo

Information about the source message referenced by the reply message.

editorUserID

editorUserID
public std::string editorUserID

The latest editor's userID for this message.

editedTime

editedTime
public unsigned long long editedTime

The latest editing timestamp for this message.

isGroupTargetedMessage

isGroupTargetedMessage
public bool isGroupTargetedMessage

Identify if this message is group targeted message.

pinnedUserID

pinnedUserID
public std::string pinnedUserID

The last user who pinned this message.

  • Use cases: This parameter is only assigned in [queryPinnedMessageList] or [onMessagePinStatusChanged].

pinnedTime

pinnedTime
public long long pinnedTime

The last timestamp when pinned this message.

  • Use cases: This parameter is only assigned in [queryPinnedMessageList] or [onMessagePinStatusChanged].

ZIMMessageLiteInfo

Base class of message lite info object.

Details

Identifies the basic parameters of a message.

Declared in ZIMDefines.h

Properties

type

type
public ZIMMessageType type

Identifies the type of this message.

ZIMMessageReaction

message reaction infos

Details

message reaction infos.

Declared in ZIMDefines.h

Properties

conversationID

conversationID
public std::string conversationID

conversationID.

conversationType

conversationType
public ZIMConversationType conversationType

conversation type.

messageID

messageID
public long long messageID

Detail description: reaction message ID.

reactionType

reactionType
public std::string reactionType

Type of reaction, defined by you, with a maximum length of 32 bytes.

isSelfIncluded

isSelfIncluded
public bool isSelfIncluded

The reaciton users if included myself.

totalCount

totalCount
public unsigned int totalCount

The reaction users number.

userList

userList
public std::vector<ZIMMessageReactionUserInfo> userList

Reaction user info list.

ZIMMessageReactionUserQueryConfig

Configuration for querying reaction user list

Details

When querying reaction member, you need to configure this object.

Declared in ZIMDefines.h

Properties

nextFlag

nextFlag
public unsigned long long nextFlag

The flag of the paging query. For the first query, set this field to an empty string. If the "nextFlag" field of the [ZIMMessageReactionUserListQueriedCallback] callback is not an empty string, it needs to be set here to continue the query on the next page.

  • Required: Not required.

count

count
public unsigned int count

How many members are retrieved in one query, 100 at most. Exceeding 100 will result in an error.

  • Caution: To obtain members in pages to reduce overhead, it is recommended to obtain within 20 members at a time. If the value is 0, the SDK will query 100 members by default.
  • Required: Required.

reactionType

reactionType
public std::string reactionType

reaction type, defined by you.

ZIMMessageRepliedListQueryConfig

Configuration for querying reply message list.

Declared in ZIMDefines.h

Properties

nextFlag

nextFlag
public unsigned long long nextFlag

The flag of paginated query. When querying for the first time, set this field to 0. If the "nextFlag" field of the [queryMessageRepliedList] callback is not 0, it means that the query has not ended yet. You need to set it here to continue querying the next page.

count

count
public unsigned int count

The number of queries per query. The upper limit is 100. Exceeding 100 will result in an error.

  • Required: Required.

ZIMMessageSendNotification

The notification callback when the message is sent, you can get the relevant information before the message object is sent through this notification

Details

Detailed description: Through this notification, developers can obtain relevant information before the message object is sent, such as localMessageID, etc.

Business scenario: When developers need to record and cache relevant information before sending a message, they can obtain it by listening to the notification.

If no monitoring is required, it can be passed null.

Declared in ZIMDefines.h

Properties

onMessageAttached

onMessageAttached
public ZIMMessageAttachedCallback onMessageAttached
  • Required: not required. If no monitoring is required, it can be passed empty.

Default: empty.

onMediaUploadingProgress

onMediaUploadingProgress
public ZIMMediaUploadingProgress onMediaUploadingProgress
  • Required: not required. If no monitoring is required, it can be passed empty.

onMultipleMediaUploadingProgress

onMultipleMediaUploadingProgress
public ZIMMultipleMediaUploadingProgress onMultipleMediaUploadingProgress

Through this notification, developers can obtain the progress callback of the media file upload in the multiple message.

  • Use cases: Developers can use it to display the upload progress of each media file and the total upload progress to improve the UI interaction experience.
  • Required: not required.
  • Available since: 2.19.0 and above.

ZIMRoomFullInfo

The room details object.

Details

Identifies the basic parameters of a message.

  • Caution: Identifies the detailed information of a room.

Declared in ZIMDefines.h

Properties

baseInfo

baseInfo
public ZIMRoomInfo baseInfo

The base object of the room.

ZIMRoomInfo

Room information object.

Details

Identifies a unique room.

Declared in ZIMDefines.h

Properties

roomID

roomID
public std::string roomID

Room ID. a string with a maximum length of 128 bytes. It is customized by the developer and supports only digits, English characters, , and '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', '{', '}', '|', ''.

roomName

roomName
public std::string roomName

Room name, It is customized by the developer .a string with a maximum length of 64 bytes or less

ZIMRoomMemberQueryConfig

Configuration for querying room member.

Details

When querying member, you need to configure this object.

Declared in ZIMDefines.h

Properties

nextFlag

nextFlag
public std::string nextFlag

The flag of the paging query. For the first query, set this field to an empty string. If the "nextFlag" field of the callback is not an empty string, it needs to be set here to continue the query on the next page.

  • Required: Not required.

count

count
public unsigned int count

How many messages are retrieved in one query.

  • Caution: To obtain messages in pages to reduce overhead, it is recommended to obtain within 100 messages at a time. If the value is 0, the SDK will query 100 room member by default.
  • Required: Required.

ZIMTextMessage

Normal text message object.

Details

Identifies the basic parameters of a message.

  • Caution: If the Type parameter of the base class is Text during callback, you can force the base class message object to be of this type.

Declared in ZIMDefines.h

Properties

message

message
public std::string message

The content of the text message.

type

type
public ZIMMessageType type

Identifies the type of this message.

messageID

messageID
public long long messageID

The unique ID that identifies this message.

  • Use cases: Can be used to index other messages.
  • Caution: When the developer actively creates a message, there is no need to modify this parameter. This parameter only has a value during callback.

timestamp

timestamp
public unsigned long long timestamp

Identifies the sending time of a message

  • Use cases: Used to present the sending time of a message, and can be used for message sorting.
  • Caution: This is a standard UNIX timestamp, in milliseconds.

senderUserID

senderUserID
public String senderUserID

Displays the userID of the sender of this message.

conversationID

conversationID
public String conversationID

Conversation ID. Ids of the same conversation type are unique.

direction

direction
public ZIMMessageDirection direction

Used to describe whether a message is sent or received.

sentStatus

sentStatus
public ZIMMessageSentStatus sentStatus

Describes the sending status of a message.

conversationType

conversationType
public ZIMConversationType conversationType

The type of conversation to which the message belongs.

conversationSeq

conversationSeq
public unsigned long long conversationSeq

Indicates the sequence number of the message in the conversation.

orderKey

orderKey
public long long orderKey

The larger the orderKey, the newer the message, and can be used for ordering messages.

localMessageID

localMessageID
public long long localMessageID

SDK locally generated MessageID, developers do not need to pay attention to.

isUserInserted

isUserInserted
public bool isUserInserted

Detail description: Describes whether the message is a message inserted by the developer through [insertMessageToLocalDB].

Default: false.

receiptStatus

receiptStatus
public ZIMMessageReceiptStatus receiptStatus

Describe the receipt status of the message

Business scenario: used to determine the status of the current message in the receipt message

extendedData

extendedData
public std::string extendedData

message extension field

  • Use cases: You can add extended fields to the message and send it to the peer
  • Required: no
  • Caution: the length is 1k, you can contact technical support for configuration
  • Available since: 2.6.0 or higher

localExtendedData

localExtendedData
public String localExtendedData

The expandable message field visible only on this end can store additional information locally, Through [updateMessageLocalExtendedData] change and currently has a length limit of 128K. If you have special requirements, please contact ZEGO technical support for configuration.

isBroadcastMessage

isBroadcastMessage
public bool isBroadcastMessage

Whether the message is pushed by all employees.

  • Required: Internal assignment.

isMentionAll

isMentionAll
public boolean isMentionAll

Whether to mention everyone. It can be presented as "@Everyone".

  • Use cases: For example, it can be used in groups or rooms.
  • Required: No.
  • Default value: false.
  • Recommended value: Set to true if you need to mention everyone.
  • Caution: This value does not add the "@Everyone" to the message text. Developers need to implement it themselves
  • Available since: 2.14.0 or above

mentionedUserIDs

mentionedUserIDs
public std::vector\<std::string> mentionedUserIDs

Whether to mention everyone. It can be presented as "@User".

  • Use cases: For example, it can be used in sending messages.
  • Required: No.
  • Caution: This value does not add the "@User" to the message text. Developers need to implement it themselves
  • Available since: 2.14.0 or above

messageSeq

messageSeq
public unsigned long long messageSeq

Indicates the sequence number of the message in the conversation.

rootRepliedCount

rootRepliedCount
public unsigned int rootRepliedCount

The number of reply messages corresponding to the root message of the reply message tree.

repliedInfo

repliedInfo
public ZIMMessageRepliedInfo repliedInfo

Information about the source message referenced by the reply message.

editorUserID

editorUserID
public std::string editorUserID

The latest editor's userID for this message.

editedTime

editedTime
public unsigned long long editedTime

The latest editing timestamp for this message.

isGroupTargetedMessage

isGroupTargetedMessage
public bool isGroupTargetedMessage

Identify if this message is group targeted message.

pinnedUserID

pinnedUserID
public std::string pinnedUserID

The last user who pinned this message.

  • Use cases: This parameter is only assigned in [queryPinnedMessageList] or [onMessagePinStatusChanged].

pinnedTime

pinnedTime
public long long pinnedTime

The last timestamp when pinned this message.

  • Use cases: This parameter is only assigned in [queryPinnedMessageList] or [onMessagePinStatusChanged].

Methods

ZIMTextMessage

ZIMTextMessage
Declared in ZIMDefines.h

ZIMTextMessageLiteInfo

Normal text message lite info object.

Details

Identifies the basic parameters of a message lite info.

  • Caution: If the Type parameter of the base class is Text during callback, you can force the base class message lite info object to be of this type.

Declared in ZIMDefines.h

Properties

message

message
public std::string message

The content of the text message.

type

type
public ZIMMessageType type

Identifies the type of this message.

Methods

ZIMTextMessageLiteInfo

ZIMTextMessageLiteInfo
Declared in ZIMDefines.h

ZIMTipsMessage

Tips message object.

Details

Identifies a tips info message.

  • Caution: If the Type parameter of the base class is Tips during callback, you can force the base class message object to be of this type.

Declared in ZIMDefines.h

Properties

event

event
public ZIMTipsMessageEvent event

The type of the tips message.

operatedUser

operatedUser
public std::shared_ptr<ZIMUserInfo> operatedUser

The initiator of the action corresponding to the tips message.

targetUserList

targetUserList
public std::vector<ZIMUserInfo> targetUserList

The target user list for the operation corresponding to the tips message.

changeInfo

changeInfo
public std::shared_ptr<ZIMTipsMessageChangeInfo> changeInfo

Additional information for the operation corresponding to the tips message.

type

type
public ZIMMessageType type

Identifies the type of this message.

messageID

messageID
public long long messageID

The unique ID that identifies this message.

  • Use cases: Can be used to index other messages.
  • Caution: When the developer actively creates a message, there is no need to modify this parameter. This parameter only has a value during callback.

timestamp

timestamp
public unsigned long long timestamp

Identifies the sending time of a message

  • Use cases: Used to present the sending time of a message, and can be used for message sorting.
  • Caution: This is a standard UNIX timestamp, in milliseconds.

senderUserID

senderUserID
public String senderUserID

Displays the userID of the sender of this message.

conversationID

conversationID
public String conversationID

Conversation ID. Ids of the same conversation type are unique.

direction

direction
public ZIMMessageDirection direction

Used to describe whether a message is sent or received.

sentStatus

sentStatus
public ZIMMessageSentStatus sentStatus

Describes the sending status of a message.

conversationType

conversationType
public ZIMConversationType conversationType

The type of conversation to which the message belongs.

conversationSeq

conversationSeq
public unsigned long long conversationSeq

Indicates the sequence number of the message in the conversation.

orderKey

orderKey
public long long orderKey

The larger the orderKey, the newer the message, and can be used for ordering messages.

localMessageID

localMessageID
public long long localMessageID

SDK locally generated MessageID, developers do not need to pay attention to.

isUserInserted

isUserInserted
public bool isUserInserted

Detail description: Describes whether the message is a message inserted by the developer through [insertMessageToLocalDB].

Default: false.

receiptStatus

receiptStatus
public ZIMMessageReceiptStatus receiptStatus

Describe the receipt status of the message

Business scenario: used to determine the status of the current message in the receipt message

extendedData

extendedData
public std::string extendedData

message extension field

  • Use cases: You can add extended fields to the message and send it to the peer
  • Required: no
  • Caution: the length is 1k, you can contact technical support for configuration
  • Available since: 2.6.0 or higher

localExtendedData

localExtendedData
public String localExtendedData

The expandable message field visible only on this end can store additional information locally, Through [updateMessageLocalExtendedData] change and currently has a length limit of 128K. If you have special requirements, please contact ZEGO technical support for configuration.

isBroadcastMessage

isBroadcastMessage
public bool isBroadcastMessage

Whether the message is pushed by all employees.

  • Required: Internal assignment.

isMentionAll

isMentionAll
public boolean isMentionAll

Whether to mention everyone. It can be presented as "@Everyone".

  • Use cases: For example, it can be used in groups or rooms.
  • Required: No.
  • Default value: false.
  • Recommended value: Set to true if you need to mention everyone.
  • Caution: This value does not add the "@Everyone" to the message text. Developers need to implement it themselves
  • Available since: 2.14.0 or above

mentionedUserIDs

mentionedUserIDs
public std::vector\<std::string> mentionedUserIDs

Whether to mention everyone. It can be presented as "@User".

  • Use cases: For example, it can be used in sending messages.
  • Required: No.
  • Caution: This value does not add the "@User" to the message text. Developers need to implement it themselves
  • Available since: 2.14.0 or above

messageSeq

messageSeq
public unsigned long long messageSeq

Indicates the sequence number of the message in the conversation.

rootRepliedCount

rootRepliedCount
public unsigned int rootRepliedCount

The number of reply messages corresponding to the root message of the reply message tree.

repliedInfo

repliedInfo
public ZIMMessageRepliedInfo repliedInfo

Information about the source message referenced by the reply message.

editorUserID

editorUserID
public std::string editorUserID

The latest editor's userID for this message.

editedTime

editedTime
public unsigned long long editedTime

The latest editing timestamp for this message.

isGroupTargetedMessage

isGroupTargetedMessage
public bool isGroupTargetedMessage

Identify if this message is group targeted message.

pinnedUserID

pinnedUserID
public std::string pinnedUserID

The last user who pinned this message.

  • Use cases: This parameter is only assigned in [queryPinnedMessageList] or [onMessagePinStatusChanged].

pinnedTime

pinnedTime
public long long pinnedTime

The last timestamp when pinned this message.

  • Use cases: This parameter is only assigned in [queryPinnedMessageList] or [onMessagePinStatusChanged].

ZIMUserFullInfo

User full information object.

Details

Identifies a unique user.

  • Caution: that the userID must be unique under the same appID, otherwise mutual kicks out will occur. It is strongly recommended that userID corresponds to the user ID of the business APP, that is, a userID and a real user are fixed and unique, and should not be passed to the SDK in a random userID. Because the unique and fixed userID allows ZEGO technicians to quickly locate online problems.

Declared in ZIMDefines.h

Properties

baseInfo

baseInfo
public ZIMUserInfo baseInfo

User basic information.

userAvatarUrl

userAvatarUrl
deprecated
public std::string userAvatarUrl
  • Required: not required.

Use restrictions: The value is a maximum of 500 bytes and contains no special characters.

Deprecated
Deprecated in version 2.13.0. To obtain the URL of a user's avatar, please refer to userAvatarUrl from the baseInfo.

extendedData

extendedData
public std::string extendedData
  • Required: not required.

Privacy Protection Statement: Do not pass in sensitive information involving personal privacy, including but not limited to mobile phone numbers, ID numbers, passport numbers, real names, etc.

ZIMUserInfo

User information object.

Details

Identifies a unique user.

  • Caution: that the userID must be unique under the same appID, otherwise mutual kicks out will occur. It is strongly recommended that userID corresponds to the user ID of the business APP, that is, a userID and a real user are fixed and unique, and should not be passed to the SDK in a random userID. Because the unique and fixed userID allows ZEGO technicians to quickly locate online problems.

Declared in ZIMDefines.h

Properties

userID

userID
public std::string userID

User ID, a string with a maximum length of 32 bytes or less. It is customized by the developer. Only support numbers, English characters and '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', '{', '}', '|', '~'.

userName

userName
public std::string userName

User name, defined by you. For version 2.0.0 and onwards, the string has a maximum length of 256 bytes.

  • Required: Not required.
  • Privacy reminder: Please do not provide sensitive personal information, including but not limited to mobile phone numbers, ID card numbers, passport numbers, and real names.

userAvatarUrl

userAvatarUrl
public String userAvatarUrl

The user avatar, which is custom generated by the developer, is not restricted by special characters and has a maximum length of 500 bytes.

  • Required: Not required.
  • Privacy reminder: Please do not provide sensitive personal information, including but not limited to mobile phone numbers, ID card numbers, passport numbers, and real names.
  • Available since: 2.13.0 and above.

userExtendedData

userExtendedData
public std::string userExtendedData

Extended field information of the user.

  • Caution: This property has a value only for room users.

Previous

Function Overview

Next

Interface