In-app Chat
On this page

Protocol

2026-07-24
ZIMZIMEventHandler

ZIM

Details

ZIM SDK main class.

Declared in ZIM.h

Methods

getVersion

static
getVersion
+ (NSString *)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.
  2. 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.

createWithAppConfig:

static
createWithAppConfig:
+ (ZIM *)createWithAppConfig:(ZIMAppConfig) appConfig;
Create a ZIM instance.
Declared in ZIM.h

Parameters

NameTypeDescription
appConfigZIMAppConfigZIMAppConfig

Details

Create a ZIM instance for subsequent calls to other member functions.

  • When to call:Before calling other member functions, you must call this API to create a ZIM example.
  • Scope of impact:Failure to call this function will prevent other member functions from being called. Platform differences: When calling this function on the Android platform, in addition to the appID, the Application class object must also be passed in.
  • Available since:2.3.0 and above.
  • Restrictions:Currently only one instance is supported, repeated calls will return [null]. Caution:
  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).

getInstance

static
getInstance
+ (ZIM *)getInstance;
Get the ZIM singleton object.
Declared in ZIM.h

Get the ZIM singleton object for subsequent calls to other member functions.

  • 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 APIs:[create].
  • Available since:2.3.0 and above.

setAdvancedConfigWithKey:value:

static
setAdvancedConfigWithKey:value:
+ (void)setAdvancedConfigWithKey:(NSString *) key value:(NSString *) value;
Set ZIM advanced configuration.
Declared in ZIM.h

Parameters

NameTypeDescription
keyNSString *Configuration Key
valueNSString *Configuration value
  • When you need to customize the set advanced configurations, you need to call this function. It must be set before calling [create] to take effect. If it is set after [create], it will take effect at the next [create].

setGeofencingConfigWithAreaList:type:

static
setGeofencingConfigWithAreaList:type:
+ (BOOL)setGeofencingConfigWithAreaList:(NSArray<int *> *) areaList type:(ZIMGeofencingType) type;
Set geofence-related configurations.
Declared in ZIM.h

Parameters

NameTypeDescription
areaListNSArray<int *> *Geofencing area list
typeZIMGeofencingTypeGeofencing type

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: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.

setLogConfig:

static
setLogConfig:
+ (void)setLogConfig:(ZIMLogConfig) config;
Set log related configuration.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMLogConfigCustom log configuration

Details

Set log related configuration, including log path and log size. Since there is a default log path inside the SDK, unless the developer has a strong need to customize the log path, it is generally not recommended that customers set it by themselves. Default value:

  • Android:/storage/Android/data/[packageName]/files/ZIMLogs
  • iOS:~/Library/Caches/ZIMLogs
  • macOS:(sandbox) ~/Library/Containers/[Bundle ID]/Data/Library/Caches/ZIMLogs /; (non-sandbox) ~/Library/Caches/ZIMLogs
  • Windows:C:/Users/[Your UserName]/AppData/[App Name]ZEGO.SDK/ZIMLogs
  • When to call:It must be called before [create].
  • Caution: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 differences: The default path of different platforms is different, please refer to the default value.
  • Related APIs:For details, please refer to https://doc-zh.zego.im/faq/IM_sdkLog?product=IM&platform=all.
  • Available since:1.1.0 and above.

setCacheConfig:

static
setCacheConfig:
+ (void)setCacheConfig:(ZIMCacheConfig) config;
Set cache related configuration.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMCacheConfigCustom cache configuration

Details

Example Set the SDK cache file path. Because the SDK has a default path, it is generally not recommended that you set your own path unless there is a strong need to do so.

  • 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
  • When to call:It must be called before [create].
  • Caution: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 differences: The default path varies with platforms. Please refer to the default value.
  • Available since:1.1.0 and above.

setCustomDispatchQueue

static
setCustomDispatchQueue
+ (void)setCustomDispatchQueue:(dispatch_queue_t) queue;
Set a custom GCD dispatch queue.
Declared in ZIM.h

Parameters

NameTypeDescription
queuedispatch_queue_t

Details

Set a custom GCD dispatch queue. Only valid on OC platform.

destroy

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

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.

  • When to call:call when ZIM is no longer needed, usually before emptying the ZIM object.
  • Caution: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.
  • Available since:1.1.0 and above.

setEventHandler:

setEventHandler:
- (void)setEventHandler:(id<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
handlerid<ZIMEventHandler>Event notification callback object

Details

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

  • When to call:After calling [create] to create an instance, this function must be called through the instance.
  • Caution: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.
  • Available since:1.1.0 and above.

uploadLog:

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

Parameters

NameTypeDescription
callbackZIMLogUploadedCallbackDevelopers can set this callback to receive the results of log uploads.

Details

By default, the SDK will create and print log files in the default directory of the App. By default, the maximum value of each log file is 5MB, and the three log files are written in a cycle. When this function is called, the SDK automatically packages and uploads the log file to the ZEGO server.

  • Use cases:Developers can provide business "feedback" channels in the App. When user feedback problems belong to ZEGO SDK, they can call this function to upload the local log information of SDK and contact ZEGO technical support to help locate user problems.
  • When to call:It must be after calling [create] to create an instance.
  • Caution:If you call [destroy] or exit the App too quickly after calling this interface to upload logs, it may fail. You are advised to wait a few seconds and then call [destroy] or exit the App after receiving the callback for successful upload.
  • Related callbacks:Developers can get the upload results through the callback parameter.
  • Available since:1.2.0 and above.
  • Restrictions:If this interface is invoked repeatedly within 10 minutes, only the last invocation takes effect.

loginWithUserID:config:callback:

loginWithUserID:config:callback:
- (void)loginWithUserID:(NSString *) userID config:(ZIMLoginConfig) config callback:(ZIMLoggedInCallback) callback;
Login, you must log in before using all functions.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDNSString *Used to identify user information, the unique ID of the user.
configZIMLoginConfigVarious parameters used for specific login actions.
callbackZIMLoggedInCallbackDevelopers can set this callback to receive the status of the login.

Details

Log in to the ZIM service. [login] is the most important step of the ZIM function. You need to log in before using any other functions.

  • When to call:This function must be called after calling [create] to create an instance and before calling other instance functions.
  • Caution:Before using ZIM's single chat, room, message sending and receiving functions, you must first call this function to log in, and the UI can be displayed to the user through the login result.
  • Privacy statement:remind users not to pass in sensitive information involving personal privacy in the userID parameter, including but not limited to mobile phone number, ID number, passport number, real name, etc.
  • 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.
  • FAQ:How is the RTC login different from ZEGO's? RTC login refers to the login to the room, ZIM login to the account.
  • References:For details, please refer to Authentication (https://docs.zegocloud.com/article/13772).
  • Available since:2.13.0 and above.

logout

logout
- (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.

renewToken:callback:

renewToken:callback:
- (void)renewToken:(NSString *) token callback:(ZIMTokenRenewedCallback) callback;
Update the authentication token.
Declared in ZIM.h

Parameters

NameTypeDescription
tokenNSString *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.
  • Life cycle:The life cycle of this function depends on the validity period of the authentication token, which is determined by the developer business.
  • References:For details, please refer to the Token generation documentation.
  • 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.

callExperimentalAPIWithParams:callback:

callExperimentalAPIWithParams:callback:
- (void)callExperimentalAPIWithParams:(NSString *) params callback:(ZIMExperimentalAPICalledCallback) callback;
Call the experimental API.
Declared in ZIM.h

Parameters

NameTypeDescription
paramsNSString *Parameters in the format of a JSON string, please consult ZEGO technical support for details.
callbackZIMExperimentalAPICalledCallbackThe result of called the experimental API.
  • ZEGO provides some technical previews or special customization functions in ZIM business through this API. If you need to get the use of the function or the details, please consult ZEGO technical support.

updateUserName:callback:

updateUserName:callback:
- (void)updateUserName:(NSString *) userName callback:(ZIMUserNameUpdatedCallback) callback;
Update user's user name.
Declared in ZIM.h

Parameters

NameTypeDescription
userNameNSString *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.
  • Caution:This interface does not support modifying user names in rooms.
  • Privacy statement: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.

updateUserAvatarUrl:callback:

updateUserAvatarUrl:callback:
- (void)updateUserAvatarUrl:(NSString *) userAvatarUrl callback:(ZIMUserAvatarUrlUpdatedCallback) callback;
Update user's avatar URL.
Declared in ZIM.h

Parameters

NameTypeDescription
userAvatarUrlNSString *User avatar URL wanted to changed to.
callbackZIMUserAvatarUrlUpdatedCallbackCallback for user profile picture update.

Details

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

  • When to call:After the user logs in.
  • Caution:The user avatar itself needs to be stored by the developer, and ZIM only saves its user information as a pass-through URL.
  • Related callbacks:[ZIMUserAvatarUrlUpdatedCallback].
  • Related APIs:[queryUsersInfo].
  • Available since:2.3.0 and above.
  • Restrictions:There is no limit on special characters and a maximum of 500 bytes.

updateUserExtendedData:callback:

updateUserExtendedData:callback:
- (void)updateUserExtendedData:(NSString *) extendedData callback:(ZIMUserExtendedDataUpdatedCallback) callback;
Update user's user extended data.
Declared in ZIM.h

Parameters

NameTypeDescription
extendedDataNSString *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 statement: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:[ZIMUserExtendedDataUpdatedCallback].
  • Related APIs:[updateUserName] and [ queryUsersInfo ].
  • Available since:2.2.0 or above.

updateUserOfflinePushRule:callback:

updateUserOfflinePushRule:callback:
- (void)updateUserOfflinePushRule:(ZIMUserOfflinePushRule) offlinePushRule callback:(ZIMUserOfflinePushRuleUpdatedCallback) callback;
Update user's 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.
callbackZIMUserOfflinePushRuleUpdatedCallbackThe callback of the update user offline push rule.

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: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.

updateUserCustomStatus:callback:

updateUserCustomStatus:callback:
- (void)updateUserCustomStatus:(NSString *) customStatus callback:(ZIMUserCustomStatusUpdatedCallback) callback;
It is used to update the user-defined status.
Declared in ZIM.h

Parameters

NameTypeDescription
customStatusNSString *User custom status.
callbackZIMUserCustomStatusUpdatedCallbackCallback for updating user custom status.

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: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

updateUserCustomStatus:config:callback:

updateUserCustomStatus:config:callback:
- (void)updateUserCustomStatus:(NSString *) customStatus config:(ZIMUserCustomStatusUpdateConfig) config callback:(ZIMUserCustomStatusUpdatedCallback) callback;
Update user's custom status.
Declared in ZIM.h

Parameters

NameTypeDescription
customStatusNSString *User custom status.
configZIMUserCustomStatusUpdateConfigConfig of user custom status.
callbackZIMUserCustomStatusUpdatedCallbackCallback for updating user custom status.
  • 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: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.

updateUserBadge:callback:

updateUserBadge:callback:
- (void)updateUserBadge:(int) badge callback:(ZIMUserBadgeUpdatedCallback) callback;
Update the number of iOS offline notification badges.
Declared in ZIM.h

Parameters

NameTypeDescription
badgeintThe user’s expected APP badge value.
callbackZIMUserBadgeUpdatedCallbackCallback for updating user badge.

Details

This API updates the APP badge count on the current user’s mobile clients. It applies to the user on mobile devices where they have logged in.

  • Use cases:In multi-device login scenarios, after the developer clears unread counts (or when unread counts change) on desktop or web, and wants mobile users’ APP badge counts to reflect and sync to the corresponding value, this API can be called to achieve that.
  • When to call:After login, with a good network connection, and when the total unread count changes. It only needs to be called on non-mobile platforms that do not support ZPNs (such as desktop and web).
  • Caution:After a successful call, the APP badge value will be updated to the specified value on all offline mobile clients where the user has logged in.
  • Related callbacks:[ZIMUserBadgeUpdatedCallback].
  • Available since:2.28.0 or above.

queryUsersInfo:config:callback:

queryUsersInfo:config:callback:
- (void)queryUsersInfo:(NSArray<NSString *> *) userIDs config:(ZIMUsersInfoQueryConfig) config callback:(ZIMUsersInfoQueriedCallback) callback;
Query user information.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *userID list.
configZIMUsersInfoQueryConfigQuery 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:It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks:[ZIMUsersInfoQueriedCallback].
  • Available since:2.3.0 or above.
  • 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.

queryUsersStatusByUserIDs:callback:

queryUsersStatusByUserIDs:callback:
- (void)queryUsersStatusByUserIDs:(NSArray<NSString *> *) userIDs callback:(ZIMUsersStatusQueriedCallback) callback;
Query the user statuses of other users.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *User ID list.
callbackZIMUsersStatusQueriedCallbackCallback 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:Can be called after login and when the network conditions are good.
  • Caution:The query targets can not include unregistered users.
  • Related callbacks:ZIMUsersStatusQueriedCallback.
  • Available since:2.18.0

querySelfUserInfo:

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

Parameters

NameTypeDescription
callbackZIMSelfUserInfoQueriedCallbackCallback for querying user information returns the query result.

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:Call after login.
  • Available since:2.15.0 .
  • Restrictions:ZIMSelfUserInfoQueriedCallback、userInfoUpdated、userRuleUpdated

subscribeUsersStatus:config:callback:

subscribeUsersStatus:config:callback:
- (void)subscribeUsersStatus:(NSArray<NSString *> *) userIDs config:(ZIMUserStatusSubscribeConfig) config callback:(ZIMUsersStatusSubscribedCallback) callback;
Subscribe to the user status of other users
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *User ID list.
configZIMUserStatusSubscribeConfigConfiguration for subscribing to user status.
callbackZIMUsersStatusSubscribedCallbackCallback for subscribing to user status.

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: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.

unsubscribeUsersStatus:callback:

unsubscribeUsersStatus:callback:
- (void)unsubscribeUsersStatus:(NSArray<NSString *> *) userIDs callback:(ZIMUsersStatusUnsubscribedCallback) callback;
This command is used to batch unsubscribe the target users in the current user subscription list.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *User ID list.
callbackZIMUsersStatusUnsubscribedCallbackCallback for unsubscribing from user status.

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: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.

querySubscribedUserStatusListWithConfig:callback:

querySubscribedUserStatusListWithConfig:callback:
- (void)querySubscribedUserStatusListWithConfig:(ZIMSubscribedUserStatusQueryConfig) config callback:(ZIMSubscribedUserStatusListQueriedCallback) callback;
This command is used to query the user status subscription list of the current user.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMSubscribedUserStatusQueryConfigConfiguration for querying subscribed user status list.
callbackZIMSubscribedUserStatusListQueriedCallbackCallback for querying subscribed user status 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: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.

queryConversationListWithConfig:callback:

queryConversationListWithConfig:callback:
- (void)queryConversationListWithConfig:(ZIMConversationQueryConfig) config callback:(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: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.

queryConversationListWithConfig:option:callback:

queryConversationListWithConfig:option:callback:
- (void)queryConversationListWithConfig:(ZIMConversationQueryConfig) config option:(ZIMConversationFilterOption) option callback:(ZIMConversationListQueriedCallback) callback;
Query the conversation list.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMConversationQueryConfigConfiguration for session queries.
optionZIMConversationFilterOptionFilter options for session queries.
callbackZIMConversationListQueriedCallbackCallback for session query.
  • 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: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.

queryConversation:conversationType:callback:

queryConversation:conversationType:callback:
- (void)queryConversation:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType callback:(ZIMConversationQueriedCallback) callback;
Query a conversation by conversation ID and conversation type.
Declared in ZIM.h

Parameters

NameTypeDescription
conversationIDNSString *Conversation ID.
conversationTypeZIMConversationTypeConversation type.
callbackZIMConversationQueriedCallbackCallback for querying conversation.

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: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.

queryConversationPinnedListWithConfig:callback:

queryConversationPinnedListWithConfig:callback:
- (void)queryConversationPinnedListWithConfig:(ZIMConversationQueryConfig) config callback:(ZIMConversationPinnedListQueriedCallback) callback;
Query the conversation pinned list.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMConversationQueryConfigConfiguration 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: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.

updateConversationPinnedState:conversationID:conversationType:callback:

updateConversationPinnedState:conversationID:conversationType:callback:
- (void)updateConversationPinnedState:(BOOL) isPinned conversationID:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType callback:(ZIMConversationPinnedStateUpdatedCallback) callback;
Modify the conversation pinned state.
Declared in ZIM.h

Parameters

NameTypeDescription
isPinnedBOOLWhether the conversation is pinned, [true] is pinned, [false] is unpinned.
conversationIDNSString *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:Can be invoked after login.
  • Related callbacks:[ZIMConversationPinnedStateUpdatedCallback].
  • Available since:2.8.0 and above.
  • Restrictions:Available after login, unavailable after logout.

deleteConversation:conversationType:config:callback:

deleteConversation:conversationType:config:callback:
- (void)deleteConversation:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType config:(ZIMConversationDeleteConfig) config callback:(ZIMConversationDeletedCallback) callback;
delete the conversation.
Declared in ZIM.h

Parameters

NameTypeDescription
conversationIDNSString *conversationID.
conversationTypeZIMConversationTypeconversationtype.
configZIMConversationDeleteConfigdelete the session's configuration.
callbackZIMConversationDeletedCallbackCallback for the result of deleting the conversation.

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: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.
  • Scope of impact: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.

deleteAllConversationsWithConfig:callback:

deleteAllConversationsWithConfig:callback:
- (void)deleteAllConversationsWithConfig:(ZIMConversationDeleteConfig) config callback:(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: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.
  • Scope of impact: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.

clearConversationUnreadMessageCount:conversationType:callback:

clearConversationUnreadMessageCount:conversationType:callback:
- (void)clearConversationUnreadMessageCount:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType callback:(ZIMConversationUnreadMessageCountClearedCallback) callback;
clear session unreads.
Declared in ZIM.h

Parameters

NameTypeDescription
conversationIDNSString *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:Called when a target needs to be cleared without readings.
  • Scope of impact:Calling this method will trigger a total readings not updated callback [onConversationTotalUnreadMessageCountUpdated], would trigger a session to update callbacks [onConversationChanged].
  • Related callbacks:[ZIMConversationUnreadMessageCountClearedCallback].
  • Related APIs:[onConversationTotalUnreadMessageCountUpdated]、[onConversationChanged].
  • Available since:2.0.0 and above.
  • Restrictions:Valid after login, invalid after logout.

clearConversationTotalUnreadMessageCount:

clearConversationTotalUnreadMessageCount:
- (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:Called when all conversation readings need to be cleared.
  • Scope of impact: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.

queryConversationTotalUnreadMessageCountWithConfig:callback:

queryConversationTotalUnreadMessageCountWithConfig:callback:
- (void)queryConversationTotalUnreadMessageCountWithConfig:(ZIMConversationTotalUnreadMessageCountQueryConfig) config callback:(ZIMConversationTotalUnreadMessageCountQueriedCallback) callback;
Query the conversations total unread message count by config.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMConversationTotalUnreadMessageCountQueryConfigConfiguration for querying the total unread count of the conversation.
callbackZIMConversationTotalUnreadMessageCountQueriedCallbackCallback to query the total unread count of the conversation.

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: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.

setConversationNotificationStatus:conversationID:conversationType:callback:

setConversationNotificationStatus:conversationID:conversationType:callback:
- (void)setConversationNotificationStatus:(ZIMConversationNotificationStatus) status conversationID:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType callback:(ZIMConversationNotificationStatusSetCallback) callback;
Set the conversation notification state.
Declared in ZIM.h

Parameters

NameTypeDescription
statusZIMConversationNotificationStatusthe session notification state.
conversationIDNSString *Conversation ID. Currently, only "group" conversations and "peer"(only for 2.14.0 or above version) conversations can be set by notification state.
conversationTypeZIMConversationTypeConversation type, such as peer, group, etc.
callbackZIMConversationNotificationStatusSetCallbackCallback to set session notification status.

Details

This method enables DND by selecting whether the unread of the target session is updated when a message is received. For conversations where Do Not Disturb is enabled, offline push notifications for that conversation are generally not received, unless the conversation is a group chat, the message sender has mentioned the current user, and the isNotifyMentionedUsers property in ZIMMessageSendConfig is set to true. In that case, the user will receive offline push notifications for that conversation.

  • 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:If the target session exists after login, invoke this interface if you want to enable the DND status of the target session.
  • Scope of impact:After the DND state is enabled, receiving messages is not triggered [conversationTotalUnreadMessageCountUpdated]。
  • Related callbacks:[ZIMConversationNotificationStatusSetCallback]。
  • Related APIs:[conversationTotalUnreadMessageCountUpdated]。
  • Available since:2.0.0 and above.
  • Restrictions:Valid after login, invalid after logout.

sendConversationMessageReceiptRead:conversationType:callback:

sendConversationMessageReceiptRead:conversationType:callback:
- (void)sendConversationMessageReceiptRead:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType callback:(ZIMConversationMessageReceiptReadSentCallback) callback;
Sets all received receipts for the conversation as read.
Declared in ZIM.h

Parameters

NameTypeDescription
conversationIDNSString *Conversation ID.
conversationTypeZIMConversationTypeConversation type, such as peer, group, etc.
callbackZIMConversationMessageReceiptReadSentCallbackCallback to set all received receipts of the conversation to be read.

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 callbacks:[ZIMConversationMessageReceiptReadSentCallback].
  • Related APIs:[sendMessageReceiptsRead], [sendMessage].
  • Available since:2.5.0 and above.

setConversationDraft:conversationID:conversationType:callback:

setConversationDraft:conversationID:conversationType:callback:
- (void)setConversationDraft:(NSString *) draft conversationID:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType callback:(ZIMConversationDraftSetCallback) callback;
Set a conversation draft.
Declared in ZIM.h

Parameters

NameTypeDescription
draftNSString *Drafts that need to be set.
conversationIDNSString *Conversation ID.
conversationTypeZIMConversationTypeConversation type, such as peer, group, etc.
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:Call when you need to set session draft, call after creating ZIM instance, take effect after login, invalid after logout.
  • Scope of impact:A successful call triggers the [onConversationChanged] callback.
  • Related callbacks:[ZIMConversationDraftSetCallback]
  • Available since:2.14.0 and above.

setConversationMark:enable:conversationInfos:callback:

setConversationMark:enable:conversationInfos:callback:
- (void)setConversationMark:(NSNumber *) markType enable:(BOOL) enable conversationInfos:(NSArray<ZIMConversationBaseInfo *> *) conversationInfos callback:(ZIMConversationMarkSetCallback) callback;
Set the conversation marked status.
Declared in ZIM.h

Parameters

NameTypeDescription
markTypeNSNumber *Mark value that needs to be set.
enableBOOLWhether to enable the mark value.
conversationInfosNSArray<ZIMConversationBaseInfo *> *Conversation information list that needs to be set.
callbackZIMConversationMarkSetCallbackCallback to set 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.

setConversationMessageDestructDuration:conversationID:conversationType:callback:

setConversationMessageDestructDuration:conversationID:conversationType:callback:
- (void)setConversationMessageDestructDuration:(int) duration conversationID:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType callback:(ZIMConversationMessageDestructDurationSetCallback) callback;
Set the timed message self-destruction duration for a conversation.
Declared in ZIM.h

Parameters

NameTypeDescription
durationintThe message self-destruction duration to set for the conversation.
conversationIDNSString *Conversation ID.
conversationTypeZIMConversationTypeConversation type, such as peer, group, etc.
callbackZIMConversationMessageDestructDurationSetCallbackCallback for the result of setting the conversation message self-destruction duration.

Details

Call this API when you need messages in a conversation to be automatically destroyed after being sent. By default, all members in the conversation can call this API.

  • Use cases:This API can be used when users have higher sensitivity or security requirements in conversation chats.
  • When to call:Can be called after creating a ZIM instance. Takes effect after login and becomes invalid after logout.
  • Scope of impact:After a successful call, the setting takes effect for both the local and peer users in peer-to-peer conversations simultaneously, and for all members in group conversations.
  • Caution:In group chat scenarios, all group members can configure this setting by default. The permission can be restricted to group owners or administrators only.
  • Related callbacks:[ZIMConversationMessageDestructDurationSetCallback].
  • Available since:3.0.0 and above.

searchLocalConversationsWithConfig:callback:

searchLocalConversationsWithConfig:callback:
- (void)searchLocalConversationsWithConfig:(ZIMConversationSearchConfig) config callback:(ZIMConversationsSearchedCallback) callback;
Search local conversations on local messages.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMConversationSearchConfigGlobal search conversation config.
callbackZIMConversationsSearchedCallbackCallback of the search conversations result.

Details

This method is used for searching local conversations based on local messages.

  • Use cases:When there is a need to search conversations using keywords or other conditions, this API can be called for searching.
  • When to call:It should be invoked when there is a requirement to search conversations using keywords or other conditions.
  • Related callbacks:[ZIMConversationsSearchedCallback].
  • Available since:2.9.0 and above.
  • Restrictions:effective after logging in and becomes invalid after logging out. Searching is not supported in room scenarios (conversationType=1).

sendMessage:toConversationID:conversationType:config:notification:callback:

sendMessage:toConversationID:conversationType:config:notification:callback:
- (void)sendMessage:(ZIMMessage) message toConversationID:(NSString *) toConversationID conversationType:(ZIMConversationType) conversationType config:(ZIMMessageSendConfig) config notification:(ZIMMessageSendNotification) notification callback:(ZIMMessageSentCallback) callback;
send message.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe message to be sent.
toConversationIDNSString *The conversation ID the message needs to be sent.
conversationTypeZIMConversationTypeThe conversation type the message needs to be sent.
configZIMMessageSendConfigRelated configuration for sending messages.
notificationZIMMessageSendNotificationRelated notifications when messages are sent.
callbackZIMMessageSentCallbackCallback of the sending result of the message.

Details

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

  • Use cases:When you need to send message to the target user, target message room, and target group chat after logging in, send it through this interface.
  • When to call:It can be called after login.
  • Related callbacks:[ZIMMessageSentCallback], [ZIMMessageSendNotification], [onPeerMessageReceived], [onRoomMessageReceived], [onGroupMessageReceived], [onConversationChanged], [onConversationTotalUnreadMessageCountUpdated].
  • Related APIs:[queryHistoryMessage], [deleteAllMessage], [deleteMessages],[sendMediaMessage].
  • Available since:2.4.0 and above.
  • Restrictions:The interval between sending messages should be greater than 100ms. Available after login, unavailable after logout.

downloadMediaFileWithMessage:fileType:config:progress:callback:

downloadMediaFileWithMessage:fileType:config:progress:callback:
- (void)downloadMediaFileWithMessage:(ZIMMessage) message fileType:(ZIMMediaFileType) fileType config:(ZIMMediaDownloadConfig) config progress:(ZIMMediaDownloadingProgress) progress callback:(ZIMMediaDownloadedCallback) callback;
Download media file message content.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe media message to download.
fileTypeZIMMediaFileTypeMedia file type.
configZIMMediaDownloadConfigDownload media file configuration.
progressZIMMediaDownloadingProgressProgress callback for downloading media files.
callbackZIMMediaDownloadedCallbackResult callback for downloading media files.

Details

This method can be used to download the content of media messages, including the original image, large image, thumbnail image, file message, audio message, video message and the first frame of the image message.

  • Use cases:After the user receives a message, if the message is a media message, he can call this API to download its content.You cannot Download Network urls before 2.9.0.
  • When to call:can be invoked after logging in and receiving a media message.
  • Caution:If [sendMediaMessage] sends a network URL, SDK earlier than 2.9.0 cannot be downloaded through this interface.
  • Related callbacks:[ZIMMediaDownloadedCallback], [ZIMMediaDownloadingProgress].
  • Available since:2.19.0 and above.
  • Restrictions:If you download an external URL, you can only download a maximum of 200MB of resources. For configuration, please contact ZEGO technical support.

queryHistoryMessageByConversationID:conversationType:config:callback:

queryHistoryMessageByConversationID:conversationType:config:callback:
- (void)queryHistoryMessageByConversationID:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType config:(ZIMMessageQueryConfig) config callback:(ZIMMessageQueriedCallback) callback;
Query historical messages.
Declared in ZIM.h

Parameters

NameTypeDescription
conversationIDNSString *The session ID of the queried historical message.
conversationTypeZIMConversationTypeconversation type.
configZIMMessageQueryConfigQuery the configuration of historical messages.
callbackZIMMessageQueriedCallbackReturns the result of querying historical messages.

Details

This method is used to query historical messages.

  • Use cases:When you need to obtain past historical messages, you can call this interface to query historical messages by paging.
  • When to call:Called when historical messages need to be queried.
  • Related callbacks:[ZIMMessageQueriedCallback].
  • Available since:2.0.0 and above.
  • 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.

queryMessagesByMessageSeqs:conversationID:conversationType:callback:

queryMessagesByMessageSeqs:conversationID:conversationType:callback:
- (void)queryMessagesByMessageSeqs:(NSArray<long long *> *) messageSeqs conversationID:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType callback:(ZIMMessageQueriedCallback) callback;
Query messages based on the message seq list.
Declared in ZIM.h

Parameters

NameTypeDescription
messageSeqsNSArray<long long *> *The list of message sequence numbers to query.
conversationIDNSString *The session ID of the queried message.
conversationTypeZIMConversationTypeconversation type.
callbackZIMMessageQueriedCallbackThe result callback for querying messages.
  • Available since:2.19.0 and above.

deleteMessages:conversationID:conversationType:config:callback:

deleteMessages:conversationID:conversationType:config:callback:
- (void)deleteMessages:(NSArray<ZIMMessage *> *) messageList conversationID:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType config:(ZIMMessageDeleteConfig) config callback:(ZIMMessageDeletedCallback) callback;
delete message.
Declared in ZIM.h

Parameters

NameTypeDescription
messageListNSArray<ZIMMessage *> *List of deleted messages.
conversationIDNSString *The session ID of the deleted message.
conversationTypeZIMConversationTypeconversation type.
configZIMMessageDeleteConfigDelete the configuration of the message.
callbackZIMMessageDeletedCallbackReturns the result of deleting the message.

Details

This method implements the function of deleting messages.

  • Use cases:The user needs to delete a message. When the user does not need to display a message, this method can be used to delete it.
  • When to call:Called when the message needs to be deleted.
  • Caution:The impact of deleting messages is limited to this account.
  • Scope of impact: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].
  • Available since:2.0.0 and above.
  • Restrictions:Effective after login.

deleteAllMessageByConversationID:conversationType:config:callback:

deleteAllMessageByConversationID:conversationType:config:callback:
- (void)deleteAllMessageByConversationID:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType config:(ZIMMessageDeleteConfig) config callback:(ZIMMessageDeletedCallback) callback;
Delete all message.
Declared in ZIM.h

Parameters

NameTypeDescription
conversationIDNSString *The session ID of the message to be deleted.
conversationTypeZIMConversationTypeconversation type.
configZIMMessageDeleteConfigdelete message configuration.
callbackZIMMessageDeletedCallbackReturns the result of deleting a message by session ID.

Details

When you need to delete all messages under the target session, call this method.

  • Use cases:If you want to implement a group setting page to clear the chat information under the current session, you can call this interface.
  • When to call:The target session exists and the user is a member of this session.
  • Caution:The impact of deleting messages is limited to this account, and messages from other accounts will not be deleted.
  • Scope of impact:The [conversationChanged] callback is triggered, and if there are unread messages, the [conversationTotalUnreadMessageCountUpdated] callback is triggered.
  • Related callbacks:[ZIMMessageDeletedCallback].
  • Available since:2.0.0 and above.
  • Restrictions:Effective after login, invalid after logout.

deleteAllConversationMessagesWithConfig:callback:

deleteAllConversationMessagesWithConfig:callback:
- (void)deleteAllConversationMessagesWithConfig:(ZIMMessageDeleteConfig) config callback:(ZIMConversationMessagesAllDeletedCallback) callback;
Delete all messages for all conversations.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMMessageDeleteConfigdelete message configuration.
callbackZIMConversationMessagesAllDeletedCallbackReturns the result of deleting all messages for all conversations.

Details

This method implements the function of deleting all messages for all sessions.

  • Use cases:The user needs to delete a message. When the user does not need to display a message, this method can be used to delete it.
  • When to call:Called when you need to delete all messages for all sessions.
  • Caution:IsAlsoDeleteServerMessage decided whether to delete a server message, the impact of deleting messages is limited to this account.
  • Scope of impact:Call the interface trigger [onMessageDeleted] callback, if there are unread messages at this time, will trigger [onConversationTotalUnreadMessageCountUpdated] callback.
  • Related callbacks:[ZIMConversationMessagesAllDeletedCallback]、[onMessageDeleted]、[onConversationTotalUnreadMessageCountUpdated].
  • Available since:2.14.0 and above.
  • Restrictions:Effective after login.

insertMessageToLocalDB:conversationID:conversationType:senderUserID:callback:

insertMessageToLocalDB:conversationID:conversationType:senderUserID:callback:
- (void)insertMessageToLocalDB:(ZIMMessage) message conversationID:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType senderUserID:(NSString *) senderUserID callback:(ZIMMessageInsertedCallback) callback;
Insert a message to the local DB.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe message to be sent.
conversationIDNSString *Conversation ID.
conversationTypeZIMConversationTypeConversation type.
senderUserIDNSString *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.

sendMessageReceiptsRead:conversationID:conversationType:callback:

sendMessageReceiptsRead:conversationID:conversationType:callback:
- (void)sendMessageReceiptsRead:(NSArray<ZIMMessage *> *) messageList conversationID:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType callback:(ZIMMessageReceiptsReadSentCallback) callback;
Set the receipt of a batch of messages to become read.
Declared in ZIM.h

Parameters

NameTypeDescription
messageListNSArray<ZIMMessage *> *The list of messages to be read with no more than 10 messages.
conversationIDNSString *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.

queryMessageReceiptsInfoByMessageList:conversationID:conversationType:callback:

queryMessageReceiptsInfoByMessageList:conversationID:conversationType:callback:
- (void)queryMessageReceiptsInfoByMessageList:(NSArray<ZIMMessage *> *) messageList conversationID:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType callback:(ZIMMessageReceiptsInfoQueriedCallback) callback;
Query the receipt information of a batch of messages.
Declared in ZIM.h

Parameters

NameTypeDescription
messageListNSArray<ZIMMessage *> *list of messages to query.
conversationIDNSString *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 and UNKNOWN are supported.

revokeMessage:config:callback:

revokeMessage:config:callback:
- (void)revokeMessage:(ZIMMessage) message config:(ZIMMessageRevokeConfig) config callback:(ZIMMessageRevokedCallback) callback;
revoke message.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe message needs to be revoke.
configZIMMessageRevokeConfigRevoke the configuration of the message.
callbackZIMMessageRevokedCallbackReturns the result of revoking the message.

Details

This method implements the function of message recall. The interface only allows recalling messages within 2 minutes. If you need to recall messages sent earlier, please contact technical support.

  • 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.
  • Caution:Room message revoke is not supported.
  • Related callbacks:If the revoked message is the latest message of the session, the [onConversationChanged] callback will be triggered, and if the message is unread, the [onConversationTotalUnreadMessageCountUpdated] callback will be triggered.
  • Available since:2.5.0 and above.
  • 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.

updateMessageLocalExtendedData:message:callback:

updateMessageLocalExtendedData:message:callback:
- (void)updateMessageLocalExtendedData:(NSString *) localExtendedData message:(ZIMMessage) message callback:(ZIMMessageLocalExtendedDataUpdatedCallback) callback;
Update the local expandable field of the message.
Declared in ZIM.h

Parameters

NameTypeDescription
localExtendedDataNSString *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.
messageZIMMessageMessage 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 statement: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.

editMessage:config:notification:callback:

editMessage:config:notification:callback:
- (void)editMessage:(ZIMMessage) message config:(ZIMMessageEditConfig) config notification:(ZIMMessageSendNotification) notification callback:(ZIMMessageEditedCallback) callback;
Edit message.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe message needs to be edited.
configZIMMessageEditConfigEdit the configuration of the message.
notificationZIMMessageSendNotificationMessage send notification object (optional).
callbackZIMMessageEditedCallbackReturns the result of editing the message.

Details

This method can be used to edit messages in single chat, group chat.

  • Use cases:When you need to edit message to the target user, target group chat after logging in, edit it through this interface.
  • Related callbacks:[ZIMMessageSendNotification], [ZIMMessageEditedCallback], [onMessageEdited], [onConversationChanged], [onMessageRepliedInfoChanged].
  • Related APIs:[queryHistoryMessage], [sendMessage].
  • Available since:2.20.0 and above.

cancelSendingMessage:config:callback:

cancelSendingMessage:config:callback:
- (void)cancelSendingMessage:(ZIMMessage) message config:(ZIMSendingMessageCancelConfig) config callback:(ZIMSendingMessageCancelledCallback) callback;
Cancels sending of media message.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe message needs to be cancelled to be sent.
configZIMSendingMessageCancelConfigThe configuration of cancelling to be sent message.
callbackZIMSendingMessageCancelledCallbackReturns the result of cancelled the sending message.

Details

This method can be used to cancel the sending of a local media file upload message.

  • Related APIs:[queryHistoryMessage], [sendMessage].
  • Available since:2.22.0 and above.

searchLocalMessagesByConversationID:conversationType:config:callback:

searchLocalMessagesByConversationID:conversationType:config:callback:
- (void)searchLocalMessagesByConversationID:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType config:(ZIMMessageSearchConfig) config callback:(ZIMMessagesSearchedCallback) callback;
Search local message list.
Declared in ZIM.h

Parameters

NameTypeDescription
conversationIDNSString *The conversation ID of the local message to be search.
conversationTypeZIMConversationTypeconversation type.
configZIMMessageSearchConfigSearch the configuration of local messages.
callbackZIMMessagesSearchedCallbackCallback of the search local message result.

Details

This method is used to search local messages.

  • Use cases:When it is necessary to search for past local messages based on keywords or other conditions, this interface can be called to perform pagination search for local messages.
  • Related callbacks:[ZIMMessagesSearchedCallback].
  • Available since:2.9.0 and above.
  • Restrictions:Effective after login, invalid after logout. Searching is not supported in the room scene (conversationType=1).

searchGlobalLocalMessagesWithConfig:callback:

searchGlobalLocalMessagesWithConfig:callback:
- (void)searchGlobalLocalMessagesWithConfig:(ZIMMessageSearchConfig) config callback:(ZIMMessagesGlobalSearchedCallback) callback;
Search global local message list.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMMessageSearchConfigSearch global the configuration of local messages.
callbackZIMMessagesGlobalSearchedCallbackCallback of the search global local message result.

Details

This method is used to search global local messages.

  • Use cases:When there is a need to perform a global search of previous local messages based on keywords or other conditions, you can invoke this interface to search local messages by grouping them according to conversations.
  • Related callbacks:[ZIMMessagesGlobalSearchedCallback].
  • Available since:2.9.0 and above.
  • Restrictions:Effective after login, invalid after logout. Searching global is not supported in the room scene (conversationType=1).

addMessageReaction:message:callback:

addMessageReaction:message:callback:
- (void)addMessageReaction:(NSString *) reactionType message:(ZIMMessage) message callback:(ZIMMessageReactionAddedCallback) callback;
add message reaction
Declared in ZIM.h

Parameters

NameTypeDescription
reactionTypeNSString *Type of reaction, defined by you, with a maximum length of 32 bytes.
messageZIMMessageThe message needs reaction.
callbackZIMMessageReactionAddedCallbackReturns the result of adding message reaction.

Details

Message reaction refers to the user's response to a message. It can generally be used to add or remove emoticons for single chat or group chat messages, as well as to initiate group voting, confirm group results, and other operations.

  • 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.
  • Caution:Room message reaction is not supported,and only messages sent within the last 7 days can be reacted to.
  • 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.
  • Available since:2.10.0 and above.
  • Restrictions:You can only use it after logging in. And only supports message reactions for single chat and group chat

addMessageReaction:message:config:callback:

addMessageReaction:message:config:callback:
- (void)addMessageReaction:(NSString *) reactionType message:(ZIMMessage) message config:(ZIMMessageReactionAddConfig) config callback:(ZIMMessageReactionAddedCallback) callback;
add message reaction
Declared in ZIM.h

Parameters

NameTypeDescription
reactionTypeNSString *Type of reaction, defined by you, with a maximum length of 32 bytes.
messageZIMMessageThe message needs reaction.
configZIMMessageReactionAddConfigAdded configuration for reactions. It now supports reacting multiple times to the same item and increases the aggregated count accordingly.
callbackZIMMessageReactionAddedCallbackReturns the result of adding message reaction.

Details

Message reaction refers to the user's response to a message. It can generally be used to add or remove emoticons for single chat or group chat messages, as well as to initiate group voting, confirm group results, and other operations.

  • 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.
  • Caution: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.
  • Available since:2.28.0 and above.
  • Restrictions:You can only use it after logging in. And only supports message reactions for single chat and group chat

deleteMessageReaction:message:callback:

deleteMessageReaction:message:callback:
- (void)deleteMessageReaction:(NSString *) reactionType message:(ZIMMessage) message callback:(ZIMMessageReactionDeletedCallback) callback;
delete message reaction
Declared in ZIM.h

Parameters

NameTypeDescription
reactionTypeNSString *Reaction type. It must be the type of reaction made by the local user.
messageZIMMessageThe message needs reaction delete.
callbackZIMMessageReactionDeletedCallbackReturns the result of deleting reaction.

Details

Delete the reaction made by the local user.

  • Use cases:Users need to delete the status of a message that has already been stated, which can be done using this method.
  • Caution: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.
  • Available since:2.10.0 and above.
  • Restrictions:You can only use it after logging in. And only supports message statements for single chat and group chat

deleteMessageAllReactionsByMessage:callback:

deleteMessageAllReactionsByMessage:callback:
- (void)deleteMessageAllReactionsByMessage:(ZIMMessage) message callback:(ZIMMessageReactionsAllDeletedCallback) callback;
Delete all of your reactions under this message
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe message needs reaction delete.
callbackZIMMessageReactionsAllDeletedCallbackReturns the result of deleting reaction.

Details

Delete all reactions made by the local user.

  • Use cases:Users need to delete the status of a message that has already been stated, which can be done using this method.
  • Caution: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.
  • Available since:2.28.0 and above.
  • Restrictions:You can only use it after logging in. And only supports message statements for single chat and group chat

queryMessageReactionUserListByMessage:config:callback:

queryMessageReactionUserListByMessage:config:callback:
- (void)queryMessageReactionUserListByMessage:(ZIMMessage) message config:(ZIMMessageReactionUserQueryConfig) config callback:(ZIMMessageReactionUserListQueriedCallback) callback;
query message reaction userlist
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe message needs querying reaction user list.
configZIMMessageReactionUserQueryConfigreaction user query config.
callbackZIMMessageReactionUserListQueriedCallbackthe result of querying reaction user list.

Details

This method is used to query specific user information under a certain state of a message.

  • 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.
  • When to call:Call when you need to query reaction user information.
  • Available since:2.10.0 and above.
  • Restrictions:You can only use it after logging in. And only supports message statements for single chat and group chat

queryCombineMessageDetailByMessage:callback:

queryCombineMessageDetailByMessage:callback:
- (void)queryCombineMessageDetailByMessage:(ZIMCombineMessage) message callback:(ZIMCombineMessageDetailQueriedCallback) callback;
query combine message detail
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMCombineMessageThe combine message needs querying message list.
callbackZIMCombineMessageDetailQueriedCallbackCallback for the result of querying combine message details.

Details

This method is used to query the sub-messages of the combine message.

  • Use cases:If you need to obtain the specific sub-messages under the combine message, you can call this API to query.
  • When to call:Call when you need to query the sub-messages of a combine message.
  • Available since:2.14.0 and above.
  • Restrictions:You can only use it after logging in.

replyMessage:toOriginalMessage:config:notification:callback:

replyMessage:toOriginalMessage:config:notification:callback:
- (void)replyMessage:(ZIMMessage) message toOriginalMessage:(ZIMMessage) toOriginalMessage config:(ZIMMessageSendConfig) config notification:(ZIMMessageSendNotification) notification callback:(ZIMMessageSentCallback) callback;
send reply message.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe message needs to be sent.
toOriginalMessageZIMMessageThe message needs to be replied.
configZIMMessageSendConfigThe configuration of the message needs to be sent.
notificationZIMMessageSendNotificationThe notification of the message needs to be sent.
callbackZIMMessageSentCallbackReturns the result of replying to the message.

Details

This method can be used to send reply messages in single chat and group chat.

  • Use cases:When you need to send reply message to the target user and target group chat after logging in, send it through this interface.
  • When to call:It can be called after login.
  • Related callbacks:[onPeerMessageReceived], [onGroupMessageReceived].
  • Related APIs:[queryHistoryMessage], [sendMessage], [sendMediaMessage].
  • Available since:2.17.0 and above.
  • Restrictions:The interval between sending messages should be greater than 100ms. Available after login, unavailable after logout.

queryMessageRepliedListByMessage:config:callback:

queryMessageRepliedListByMessage:config:callback:
- (void)queryMessageRepliedListByMessage:(ZIMMessage) message config:(ZIMMessageRepliedListQueryConfig) config callback:(ZIMMessageRepliedListQueriedCallback) callback;
Query message replied list.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe message needs to be queried replied list.
configZIMMessageRepliedListQueryConfigThe configuration of the message needs to be queried replied list.
callbackZIMMessageRepliedListQueriedCallbackReturns the result of querying replied list.

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.

pinMessage:isPinned:callback:

pinMessage:isPinned:callback:
- (void)pinMessage:(ZIMMessage) message isPinned:(BOOL) isPinned callback:(ZIMMessagePinnedCallback) callback;
Pin or unpin message.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe message needs to be pinned.
isPinnedBOOLWhether to pin.
callbackZIMMessagePinnedCallbackReturns the result of pinning message.

Details

This method can be used to pin or unpin successfully sent messages in single chats or group chats.

  • Use cases:After logging in, when you need to pin or unpin a successfully sent message to a target user or target group chat, perform the operation via this interface.
  • Related callbacks:[ZIMMessagePinnedCallback], [onMessagePinStatusChanged].
  • Related APIs:[queryPinnedMessageList], [sendMessage].
  • Available since:2.25.0 and above.

pinMessage:isPinned:config:callback:

pinMessage:isPinned:config:callback:
- (void)pinMessage:(ZIMMessage) message isPinned:(BOOL) isPinned config:(ZIMMessagePinConfig) config callback:(ZIMMessagePinnedCallback) callback;
Pin message.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe message needs to be pinned.
isPinnedBOOLWhether to pin.
configZIMMessagePinConfigPinning configuration parameters.
callbackZIMMessagePinnedCallbackReturns the result of pinning message.
  • Use cases:After logging in, when you need to pin or unpin a successfully sent message for a target user or target group chat, use this API to perform the operation.
  • Related callbacks:ZIMMessagePinnedCallback, onMessagePinStatusChanged.
  • Related APIs:queryPinnedMessageList, sendMessage.

queryPinnedMessageListByConversationID:conversationType:callback:

queryPinnedMessageListByConversationID:conversationType:callback:
- (void)queryPinnedMessageListByConversationID:(NSString *) conversationID conversationType:(ZIMConversationType) conversationType callback:(ZIMPinnedMessageListQueriedCallback) callback;
Query pinned message list.
Declared in ZIM.h

Parameters

NameTypeDescription
conversationIDNSString *Conversation ID.
conversationTypeZIMConversationTypeConversation type.
callbackZIMPinnedMessageListQueriedCallbackReturns the result of querying pinned message list.

Details

This method is used to query the list of pinned messages.

  • Use cases:When you need to display pinned messages, you can call this interface to query the list of pinned messages within a conversation.
  • When to call:Called when pinned messages need to be queried.
  • Related callbacks:[ZIMPinnedMessageListQueriedCallback].
  • Available since:2.25.0 and above.
  • Restrictions:The SDK must be logged in and the message pinning feature must be supported to use this interface.

queryLocalFileCacheWithConfig:callback:

queryLocalFileCacheWithConfig:callback:
- (void)queryLocalFileCacheWithConfig:(ZIMFileCacheQueryConfig) config callback:(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.

Details

Query the local message cache of the current user.

  • Use cases:This interface is invoked when the local message cache needs to be queried.
  • Related callbacks:[ZIMFileCacheQueriedCallback].
  • Available since:2.15.0 and above.
  • Restrictions:This takes effect after the login and becomes invalid after the logout.

clearLocalFileCacheWithConfig:callback:

clearLocalFileCacheWithConfig:callback:
- (void)clearLocalFileCacheWithConfig:(ZIMFileCacheClearConfig) config callback:(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.

Details

Clear the local message cache of the current user.

  • Use cases:This interface is invoked when the local message cache needs to be cleared.
  • Related callbacks:[ZIMFileCacheClearedCallback].
  • Available since:2.15.0 and above.
  • Restrictions:This takes effect after the login and becomes invalid after the logout.

createRoom:callback:

createRoom:callback:
- (void)createRoom:(ZIMRoomInfo) roomInfo callback:(ZIMRoomCreatedCallback) callback;
Create and join a room.
Declared in ZIM.h

Parameters

NameTypeDescription
roomInfoZIMRoomInfoThe 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.
  • Related callbacks:The result of the room creation can be obtained through the [ZIMRoomCreatedCallback] callback.
  • Related APIs:You can join the room through [joinRoom] and leave the room with [leaveRoom].
  • Available since:1.1.0 or above.
  • Restrictions:If the room already exists, an error will occur when calling this API. For details, please refer to the returned error code handling.

createRoom:config:callback:

createRoom:config:callback:
- (void)createRoom:(ZIMRoomInfo) roomInfo config:(ZIMRoomAdvancedConfig) config callback:(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.

  • Use cases:When you need to create a multi-person chat scenario with custom attributes, use this API to create and join a room.
  • When to call:Can be called after login.
  • Caution:After all users leave the room, it will be automatically destroyed. A user can be in at most 5 rooms at the same time.
  • Related callbacks:The result of creating a room can be obtained through the [onRoomCreated] callback.
  • Related APIs:Use [joinRoom] to join a room, and [leaveRoom] to leave a room.
  • Available since:1.3.0.
  • Restrictions:If the room already exists, calling this API will result in an error. Please refer to the returned error code for handling.

joinRoom:callback:

joinRoom:callback:
- (void)joinRoom:(NSString *) roomID callback:(ZIMRoomJoinedCallback) callback;
Join a room.
Declared in ZIM.h

Parameters

NameTypeDescription
roomIDNSString *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.

enterRoom:config:callback:

enterRoom:config:callback:
- (void)enterRoom:(ZIMRoomInfo) roomInfo config:(ZIMRoomAdvancedConfig) config callback:(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.

Details

After calling this API, If the room already exists, join the room directly; if the room does not exist, create a room and join. At the same time, if the room does not exist, after calling this interface, the room advanced properties set by the user will take effect.

  • Use cases:When you need to enter a multi-person chat scene with custom attributes, and you do not need to distinguish whether the room is created or added, you can enter a room through this interface.
  • When to call:It can be called after logging in.
  • Caution: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 [ZIMRoomEnteredCallback] callback.
  • Related APIs:You can enter the room through [enterRoom], and leave the room through [leaveRoom].
  • Available since:2.1.0.

switchRoomFromRoomID:toRoomInfo:isCreateWhenRoomNotExisted:config:callback:

switchRoomFromRoomID:toRoomInfo:isCreateWhenRoomNotExisted:config:callback:
- (void)switchRoomFromRoomID:(NSString *) fromRoomID toRoomInfo:(ZIMRoomInfo) toRoomInfo isCreateWhenRoomNotExisted:(BOOL) isCreateWhenRoomNotExisted config:(ZIMRoomAdvancedConfig) config callback:(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
fromRoomIDNSString *ID of the source room to switch.
toRoomInfoZIMRoomInfoConfiguration information for the room to switch to.
isCreateWhenRoomNotExistedBOOLWhether to create the room if it does not exist.
configZIMRoomAdvancedConfigAdvanced properties for the room to switch to.
callbackZIMRoomSwitchedCallbackCallback of the result of switching the room.

Details

After calling this API, If the room already exists, join the room directly; if the room does not exist, create a room and join. At the same time, if the room does not exist, after calling this interface, the room advanced properties set by the user will take effect.

  • Use cases:Scenarios that require quick switching from one room to another.
  • 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.
  • Available since:2.18.0.

leaveRoom:callback:

leaveRoom:callback:
- (void)leaveRoom:(NSString *) roomID callback:(ZIMRoomLeftCallback) callback;
Leave a room.
Declared in ZIM.h

Parameters

NameTypeDescription
roomIDNSString *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.

leaveAllRoom:

leaveAllRoom:
- (void)leaveAllRoom:(ZIMRoomAllLeftCallback) callback;
Leave all rooms entered.
Declared in ZIM.h

Parameters

NameTypeDescription
callbackZIMRoomAllLeftCallbackCallback of the result of leave the room.

Details

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

  • 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, leaving will fail; and calling this interface can only leave the room entered under the current terminal, and will not affect the rooms entered by other terminals with multi-terminal login.
  • Related callbacks:The result of leaving the room can be obtained through the [ZIMRoomAllLeftCallback] callback.
  • Available since:2.15.0 or above.

queryRoomMemberListByRoomID:config:callback:

queryRoomMemberListByRoomID:config:callback:
- (void)queryRoomMemberListByRoomID:(NSString *) roomID config:(ZIMRoomMemberQueryConfig) config callback:(ZIMRoomMemberQueriedCallback) callback;
Query the list of members in the room.
Declared in ZIM.h

Parameters

NameTypeDescription
roomIDNSString *ID of the room to query.
configZIMRoomMemberQueryConfigConfiguration 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.

queryRoomMembersByUserIDs:roomID:callback:

queryRoomMembersByUserIDs:roomID:callback:
- (void)queryRoomMembersByUserIDs:(NSArray<NSString *> *) userIDs roomID:(NSString *) roomID callback:(ZIMRoomMembersQueriedCallback) callback;
Query the information of the specified userID in the specified room.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *List of user IDs to query.
roomIDNSString *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: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.

queryRoomOnlineMemberCountByRoomID:callback:

queryRoomOnlineMemberCountByRoomID:callback:
- (void)queryRoomOnlineMemberCountByRoomID:(NSString *) roomID callback:(ZIMRoomOnlineMemberCountQueriedCallback) callback;
Query the number of online members in the room.
Declared in ZIM.h

Parameters

NameTypeDescription
roomIDNSString *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.
  • When to call: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 [queryRoomMemberList].
  • Available since:1.1.0 or above.

setRoomAttributes:roomID:config:callback:

setRoomAttributes:roomID:config:callback:
- (void)setRoomAttributes:(NSDictionary<NSString, NSString> *) roomAttributes roomID:(NSString *) roomID config:(ZIMRoomAttributesSetConfig) config callback:(ZIMRoomAttributesOperatedCallback) callback;
Set room attributes (use this for all additions and changes).
Declared in ZIM.h

Parameters

NameTypeDescription
roomAttributesNSDictionary<NSString, NSString> *Room attributes to be set.
roomIDNSString *To modify the room number of the room attribute.
configZIMRoomAttributesSetConfigBehavior 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:after login, and in the relevant room to call.
  • Caution:Key-value of the room property. The default key length is 16 and the default value length is 1024.
  • 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 statement: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.
  • 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.

deleteRoomAttributesByKeys:roomID:config:callback:

deleteRoomAttributesByKeys:roomID:config:callback:
- (void)deleteRoomAttributesByKeys:(NSArray<NSString *> *) keys roomID:(NSString *) roomID config:(ZIMRoomAttributesDeleteConfig) config callback:(ZIMRoomAttributesOperatedCallback) callback;
Delete room attributes.
Declared in ZIM.h

Parameters

NameTypeDescription
keysNSArray<NSString *> *The key of the room attribute to be deleted.
roomIDNSString *To modify the room number of the room attribute
configZIMRoomAttributesDeleteConfigBehavior configuration of the operation.
callbackZIMRoomAttributesOperatedCallbackOperation callback for setting room properties.

Details

Used to delete room attributes.

  • Use cases:This interface can be used when a voice chat room needs to delete a seat.
  • When to call:After login and while in the relevant room.
  • Default value:The default configuration when [ZIMRoomAttributesDeleteConfig] is empty is non-forced operation.
  • Scope of impact:Deletes the room attributes of the existing room.
  • Related callbacks:[ZIMRoomAttributesOperatedCallback].
  • Related APIs:[setRoomAttributes] to set room attributes. [queryRoomAllAttributes] to query room attributes.
  • Available since:1.3.0.

beginRoomAttributesBatchOperationWithRoomID:config:

beginRoomAttributesBatchOperationWithRoomID:config:
- (void)beginRoomAttributesBatchOperationWithRoomID:(NSString *) roomID config:(ZIMRoomAttributesBatchOperationConfig *) config;
Open combination room attribute operation.
Declared in ZIM.h

Parameters

NameTypeDescription
roomIDNSString *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.

  • Use cases:When a voice chat room needs to switch seats, this interface can be used to initiate a batch operation.
  • When to call:After login and while in the relevant room.
  • Caution:After starting batch operations on room attributes, all set and delete operations will be included in the batch until the batch operation is complete. Consecutive calls reset the state. Not calling [endRoomAttributesBatchOperation] is treated as no operation.
  • Scope of impact:After being enabled, set and delete room attribute operations will be included in this batch operation.
  • Related APIs:[endRoomAttributesBatchOperation] to complete the batch operation.
  • Available since:1.3.0.

endRoomAttributesBatchOperationWithRoomID:callback:

endRoomAttributesBatchOperationWithRoomID:callback:
- (void)endRoomAttributesBatchOperationWithRoomID:(NSString *) roomID callback:(ZIMRoomAttributesBatchOperatedCallback) callback;
Complete the property operation of the combined room.
Declared in ZIM.h

Parameters

NameTypeDescription
roomIDNSString *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.

  • Use cases:This interface can be used when a voice chat room needs to switch seats.
  • When to call:After login, execute after [beginRoomAttributesBatchOperation].
  • Caution:Calling without [beginRoomAttributesBatchOperation] will return an error. Not calling [endRoomAttributesBatchOperation] after [beginRoomAttributesBatchOperation] is treated as no operation.
  • Scope of impact:Set and delete room attributes within the same room.
  • Related callbacks:[ZIMRoomAttributesBatchOperatedCallback].
  • Related APIs:[beginRoomAttributesBatchOperation] to start the batch operation.
  • Available since:1.3.0.
  • Restrictions:Requires that batch operations have been started in the room.

queryRoomAllAttributesByRoomID:callback:

queryRoomAllAttributesByRoomID:callback:
- (void)queryRoomAllAttributesByRoomID:(NSString *) roomID callback:(ZIMRoomAttributesQueriedCallback) callback;
Query all properties of the room.
Declared in ZIM.h

Parameters

NameTypeDescription
roomIDNSString *Need to query the room number of the custom attributes.
callbackZIMRoomAttributesQueriedCallbackCallback for querying room attributes.

Details

Used to query room attributes.

  • When to call:After login and while in the relevant room.
  • Use cases:This interface can be used when a voice chat room needs to query seat information.
  • Related callbacks:[ZIMRoomAttributesQueriedCallback].
  • Related APIs:[deleteRoomAttributes] to delete room attributes. [setRoomAttributes] to set room attributes.
  • Available since:1.3.0.

setRoomMembersAttributes:userIDs:roomID:config:callback:

setRoomMembersAttributes:userIDs:roomID:config:callback:
- (void)setRoomMembersAttributes:(NSDictionary<NSString, NSString> *) attributes userIDs:(NSArray<NSString *> *) userIDs roomID:(NSString *) roomID config:(ZIMRoomMemberAttributesSetConfig) config callback:(ZIMRoomMembersAttributesOperatedCallback) callback;
Set room member attributes (use this for all additions and changes).
Declared in ZIM.h

Parameters

NameTypeDescription
attributesNSDictionary<NSString, NSString> *Room member attributes to be set.
userIDsNSArray<NSString *> *A list of userIDs to set.
roomIDNSString *Room ID.
configZIMRoomMemberAttributesSetConfigBehavior configuration of the operation.
callbackZIMRoomMembersAttributesOperatedCallbackAction callback for setting room members attributes.

Details

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

  • Use cases:If you need to set a level for members in the room, you can use this interface to set a state.
  • Default value:[ZIMRoomMemberAttributesSetConfig] Default constructor isDeleteAfterOwnerLeft is true.
  • When to call:After logging in and calling in the relevant room.
  • Related callbacks:[ZIMRoomMembersAttributesOperatedCallback],[onRoomMemberAttributesUpdated].
  • Related APIs:[queryRoomMembersAttributes], [queryRoomMemberAttributesList].
  • Available since:2.4.0 and above.
  • Restrictions: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.

queryRoomMembersAttributesByUserIDs:roomID:callback:

queryRoomMembersAttributesByUserIDs:roomID:callback:
- (void)queryRoomMembersAttributesByUserIDs:(NSArray<NSString *> *) userIDs roomID:(NSString *) roomID callback:(ZIMRoomMembersAttributesQueriedCallback) callback;
Batch query the room user attributes of the members in the room.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *A list of userIDs to query.
roomIDNSString *Room 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].
  • Life cycle: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.

queryRoomMemberAttributesListByRoomID:config:callback:

queryRoomMemberAttributesListByRoomID:config:callback:
- (void)queryRoomMemberAttributesListByRoomID:(NSString *) roomID config:(ZIMRoomMemberAttributesQueryConfig) config callback:(ZIMRoomMemberAttributesListQueriedCallback) callback;
paginate the room user properties that have room property members in the room.
Declared in ZIM.h

Parameters

NameTypeDescription
roomIDNSString *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].
  • Life cycle: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.

createGroup:userIDs:callback:

createGroup:userIDs:callback:
- (void)createGroup:(ZIMGroupInfo) groupInfo userIDs:(NSArray<NSString *> *) userIDs callback:(ZIMGroupCreatedCallback) callback;
Create groups.
Declared in ZIM.h

Parameters

NameTypeDescription
groupInfoZIMGroupInfoBasic information of the group to be created.
userIDsNSArray<NSString *> *Configuration information for the group to be created.
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].
  • Scope of impact: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. It is not possible to use a previously used groupID to create a group again, regardless of whether the previous group has been dismissed.

createGroup:userIDs:config:callback:

createGroup:userIDs:config:callback:
- (void)createGroup:(ZIMGroupInfo) groupInfo userIDs:(NSArray<NSString *> *) userIDs config:(ZIMGroupAdvancedConfig) config callback:(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.
userIDsNSArray<NSString *> *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: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.

dismissGroup:callback:

dismissGroup:callback:
- (void)dismissGroup:(NSString *) groupID callback:(ZIMGroupDismissedCallback) callback;
Dismiss the group.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDNSString *The ID of the group to be dismissed.
callbackZIMGroupDismissedCallbackCallback for the result of dismissing 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: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.

joinGroup:callback:

joinGroup:callback:
- (void)joinGroup:(NSString *) groupID callback:(ZIMGroupJoinedCallback) callback;
Join a group.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDNSString *The group ID to join.
callbackZIMGroupJoinedCallbackCallback for the result of joining the group.

Details

After a group is created, other users can use [joinGroup] to join the group.

  • Use cases:This interface is used to join a group in a chat scenario.
  • When to call: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. A group is limited to 500 people and fails to join when it is full.
  • 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.

leaveGroup:callback:

leaveGroup:callback:
- (void)leaveGroup:(NSString *) groupID callback:(ZIMGroupLeftCallback) callback;
Leave the group.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDNSString *The 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: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.
  • Scope of impact: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.

inviteUsersIntoGroup:groupID:callback:

inviteUsersIntoGroup:groupID:callback:
- (void)inviteUsersIntoGroup:(NSArray<NSString *> *) userIDs groupID:(NSString *) groupID callback:(ZIMGroupUsersInvitedCallback) callback;
invite some members into the group.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *The list of user IDs to invite into the group.
groupIDNSString *The target group ID.
callbackZIMGroupUsersInvitedCallbackCallback for the result of inviting users into the group.

Details

After a group is created, users can add multiple users to the group through this interface. The interface can be invoked by both the master and members of the group.

  • Use cases:This interface allows you to invite others to join a group chat.
  • When to call: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. The service layer determines the number of invited users.
  • Related callbacks:Through the callback [ZIMGroupUsersInvitedCallback] can add multiple users into the group's results.
  • Related APIs:KickGroupMember can be used to kick a target user out of the group.
  • Available since:2.0.0 and above.
  • Restrictions:The maximum number of userIDs users can join the group is 100. If the number of users reaches 100, the interface callback will notify the user. The maximum number of people in a group is 500.

kickGroupMembers:groupID:callback:

kickGroupMembers:groupID:callback:
- (void)kickGroupMembers:(NSArray<NSString *> *) userIDs groupID:(NSString *) groupID callback:(ZIMGroupMemberKickedCallback) callback;
kick some members out of the group.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *The list of user IDs to kick out of the group.
groupIDNSString *The target group ID.
callbackZIMGroupMemberKickedCallbackCallback for the result of kicking members 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: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.

transferGroupOwnerToUserID:groupID:callback:

transferGroupOwnerToUserID:groupID:callback:
- (void)transferGroupOwnerToUserID:(NSString *) toUserID groupID:(NSString *) groupID callback:(ZIMGroupOwnerTransferredCallback) callback;
Transfer the group owner.
Declared in ZIM.h

Parameters

NameTypeDescription
toUserIDNSString *The user ID of the new group owner.
groupIDNSString *The target group ID.
callbackZIMGroupOwnerTransferredCallbackCallback for the result of transferring the 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: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.

queryGroupInfoByGroupID:callback:

queryGroupInfoByGroupID:callback:
- (void)queryGroupInfoByGroupID:(NSString *) groupID callback:(ZIMGroupInfoQueriedCallback) callback;
Query group information.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDNSString *The 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: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.

queryGroupMemberInfoByUserID:groupID:callback:

queryGroupMemberInfoByUserID:groupID:callback:
- (void)queryGroupMemberInfoByUserID:(NSString *) userID groupID:(NSString *) groupID callback:(ZIMGroupMemberInfoQueriedCallback) callback;
Query group member information.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDNSString *User ID of the queried member information.
groupIDNSString *The 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: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.

queryGroupList:

queryGroupList:
- (void)queryGroupList:(ZIMGroupListQueriedCallback) callback;
Query the 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: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.

queryGroupListWithCount:config:callback:

queryGroupListWithCount:config:callback:
- (void)queryGroupListWithCount:(unsigned int) count config:(ZIMGroupListQueryConfig) config callback:(ZIMGroupListQueriedCallback) callback;
Query the group list.
Declared in ZIM.h

Parameters

NameTypeDescription
countunsigned intThe number of groups to query.
configZIMGroupListQueryConfigGroup list query configuration.
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: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.27.0 and above.
  • Restrictions:Available after login, unavailable after logout.

queryGroupMemberListByGroupID:config:callback:

queryGroupMemberListByGroupID:config:callback:
- (void)queryGroupMemberListByGroupID:(NSString *) groupID config:(ZIMGroupMemberQueryConfig) config callback:(ZIMGroupMemberListQueriedCallback) callback;
Query the list of group members.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDNSString *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: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.

queryGroupMemberCountByGroupID:callback:

queryGroupMemberCountByGroupID:callback:
- (void)queryGroupMemberCountByGroupID:(NSString *) groupID callback:(ZIMGroupMemberCountQueriedCallback) callback;
Query the number of group members in a specified group.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDNSString *The group ID of the group to be queried.
callbackZIMGroupMemberCountQueriedCallbackCallback for querying the number of group members.

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.

updateGroupName:groupID:callback:

updateGroupName:groupID:callback:
- (void)updateGroupName:(NSString *) groupName groupID:(NSString *) groupID callback:(ZIMGroupNameUpdatedCallback) callback;
Update the group name.
Declared in ZIM.h

Parameters

NameTypeDescription
groupNameNSString *The new group name.
groupIDNSString *The target group ID.
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: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.

updateGroupAvatarUrl:groupID:callback:

updateGroupAvatarUrl:groupID:callback:
- (void)updateGroupAvatarUrl:(NSString *) groupAvatarUrl groupID:(NSString *) groupID callback:(ZIMGroupAvatarUrlUpdatedCallback) callback;
Update the group avatar URL.
Declared in ZIM.h

Parameters

NameTypeDescription
groupAvatarUrlNSString *The new group avatar URL.
groupIDNSString *The target group ID.
callbackZIMGroupAvatarUrlUpdatedCallbackCallback for the result of updating the group avatar URL.

Details

After a group is created, the user can modify the group avatar URL by calling this method.

  • Use cases:After creating a group, the user needs to change the group avatar URL.
  • When to call:It can be invoked after creating a ZIM instance through [create] and logging in.
  • 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.
  • Available since:2.3.0 and above.
  • Restrictions:Group members and group owners can modify the group avatar, with a maximum length of 500 bytes.

updateGroupNotice:groupID:callback:

updateGroupNotice:groupID:callback:
- (void)updateGroupNotice:(NSString *) groupNotice groupID:(NSString *) groupID callback:(ZIMGroupNoticeUpdatedCallback) callback;
Update group announcements.
Declared in ZIM.h

Parameters

NameTypeDescription
groupNoticeNSString *The new group notice content.
groupIDNSString *The target group ID.
callbackZIMGroupNoticeUpdatedCallbackCallback for the result of updating the group notice.

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:The ZIM instance can be invoked after being created by [create] and logged in.
  • Related callbacks:Through callback [ZIMGroupNoticeUpdatedCallback] 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.

updateGroupAlias:groupID:callback:

updateGroupAlias:groupID:callback:
- (void)updateGroupAlias:(NSString *) groupAlias groupID:(NSString *) groupID callback:(ZIMGroupAliasUpdatedCallback) callback;
Update the group alias.
Declared in ZIM.h

Parameters

NameTypeDescription
groupAliasNSString *The new group alias.
groupIDNSString *The target group ID.
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.

updateGroupJoinMode:groupID:callback:

updateGroupJoinMode:groupID:callback:
- (void)updateGroupJoinMode:(ZIMGroupJoinMode) mode groupID:(NSString *) groupID callback:(ZIMGroupJoinModeUpdatedCallback) callback;
Update group verification mode.
Declared in ZIM.h

Parameters

NameTypeDescription
modeZIMGroupJoinModeThe group join mode.
groupIDNSString *The target group ID.
callbackZIMGroupJoinModeUpdatedCallbackCallback for the result of updating the group join mode.

Details

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

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

updateGroupInviteMode:groupID:callback:

updateGroupInviteMode:groupID:callback:
- (void)updateGroupInviteMode:(ZIMGroupInviteMode) mode groupID:(NSString *) groupID callback:(ZIMGroupInviteModeUpdatedCallback) callback;
Update group verification mode.
Declared in ZIM.h

Parameters

NameTypeDescription
modeZIMGroupInviteModeThe group invite mode.
groupIDNSString *The target group ID.
callbackZIMGroupInviteModeUpdatedCallbackCallback for the result of updating the group invite mode.

Details

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

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

updateGroupBeInviteMode:groupID:callback:

updateGroupBeInviteMode:groupID:callback:
- (void)updateGroupBeInviteMode:(ZIMGroupBeInviteMode) mode groupID:(NSString *) groupID callback:(ZIMGroupBeInviteModeUpdatedCallback) callback;
Update group verification mode.
Declared in ZIM.h

Parameters

NameTypeDescription
modeZIMGroupBeInviteModeThe group be-invite mode.
groupIDNSString *The target group ID.
callbackZIMGroupBeInviteModeUpdatedCallbackCallback for the result of updating the group be-invite mode.

Details

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

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

setGroupAttributes:groupID:callback:

setGroupAttributes:groupID:callback:
- (void)setGroupAttributes:(NSDictionary<NSString, NSString> *) groupAttributes groupID:(NSString *) groupID callback:(ZIMGroupAttributesOperatedCallback) callback;
Add or update group attributes.
Declared in ZIM.h

Parameters

NameTypeDescription
groupAttributesNSDictionary<NSString, NSString> *The group attributes to set, in key-value pairs.
groupIDNSString *The target group ID.
callbackZIMGroupAttributesOperatedCallbackCallback for the result of 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: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, [queryGroupAllAttributes] can be used to queryAllGroupAttributes.
  • Available since:2.0.0 and above.
  • Restrictions:Only group members can set group attributes.

deleteGroupAttributesByKeys:groupID:callback:

deleteGroupAttributesByKeys:groupID:callback:
- (void)deleteGroupAttributesByKeys:(NSArray<NSString *> *) keys groupID:(NSString *) groupID callback:(ZIMGroupAttributesOperatedCallback) callback;
Delete group attributes.
Declared in ZIM.h

Parameters

NameTypeDescription
keysNSArray<NSString *> *The list of group attribute keys to delete.
groupIDNSString *The target group ID.
callbackZIMGroupAttributesOperatedCallbackCallback for the result of deleting 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: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.

queryGroupAttributesByKeys:groupID:callback:

queryGroupAttributesByKeys:groupID:callback:
- (void)queryGroupAttributesByKeys:(NSArray<NSString *> *) keys groupID:(NSString *) groupID callback:(ZIMGroupAttributesQueriedCallback) callback;
Query group attributes by keys.
Declared in ZIM.h

Parameters

NameTypeDescription
keysNSArray<NSString *> *The list of group attribute keys to query.
groupIDNSString *The target group ID.
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:After creating a ZIM instance with [create] and logging in with [login].
  • Related callbacks:Through the callback [ZIMGroupAttributesQueriedCallback] 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.

queryGroupAllAttributesByGroupID:callback:

queryGroupAllAttributesByGroupID:callback:
- (void)queryGroupAllAttributesByGroupID:(NSString *) groupID callback:(ZIMGroupAttributesQueriedCallback) callback;
Query all attributes of the group.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDNSString *The target group ID.
callbackZIMGroupAttributesQueriedCallbackCallback for the result of querying all group attributes.

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: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.

setGroupMemberRole:forUserID:groupID:callback:

setGroupMemberRole:forUserID:groupID:callback:
- (void)setGroupMemberRole:(ZIMGroupMemberRole) role forUserID:(NSString *) forUserID groupID:(NSString *) groupID callback:(ZIMGroupMemberRoleUpdatedCallback) callback;
Set the group member role.
Declared in ZIM.h

Parameters

NameTypeDescription
roleZIMGroupMemberRoleThe role value to set for the group member.
forUserIDNSString *The user ID of the target group member.
groupIDNSString *The target group ID.
callbackZIMGroupMemberRoleUpdatedCallbackCallback for the result of setting 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: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.

setGroupMemberNickname:forUserID:groupID:callback:

setGroupMemberNickname:forUserID:groupID:callback:
- (void)setGroupMemberNickname:(NSString *) nickname forUserID:(NSString *) forUserID groupID:(NSString *) groupID callback:(ZIMGroupMemberNicknameUpdatedCallback) callback;
Set the group member nickname.
Declared in ZIM.h

Parameters

NameTypeDescription
nicknameNSString *The new group member nickname.
forUserIDNSString *The user ID of the target group member.
groupIDNSString *The target group ID.
callbackZIMGroupMemberNicknameUpdatedCallbackCallback for the result of setting the group member 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: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.

muteGroup:groupID:config:callback:

muteGroup:groupID:config:callback:
- (void)muteGroup:(BOOL) isMute groupID:(NSString *) groupID config:(ZIMGroupMuteConfig) config callback:(ZIMGroupMutedCallback) callback;
Mute a group.
Declared in ZIM.h

Parameters

NameTypeDescription
isMuteBOOLWhether to mute. [true] means mute, [false] means unmute.
groupIDNSString *The target group ID.
configZIMGroupMuteConfigGroup mute configuration.
callbackZIMGroupMutedCallbackCallback for the result of muting/unmuting the group.

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 [onGroupMutedInfoUpdated].
  • Available since:2.14.0 and above.
  • Restrictions:This can be called by the group owner and group administrators.

muteGroupMembers:userIDs:groupID:config:callback:

muteGroupMembers:userIDs:groupID:config:callback:
- (void)muteGroupMembers:(BOOL) isMute userIDs:(NSArray<NSString *> *) userIDs groupID:(NSString *) groupID config:(ZIMGroupMemberMuteConfig) config callback:(ZIMGroupMembersMutedCallback) callback;
Mute group members.
Declared in ZIM.h

Parameters

NameTypeDescription
isMuteBOOLWhether to mute. [true] means mute, [false] means unmute.
userIDsNSArray<NSString *> *The list of user IDs to mute/unmute.
groupIDNSString *The target group ID.
configZIMGroupMemberMuteConfigGroup member mute configuration.
callbackZIMGroupMembersMutedCallbackCallback for the result of muting/unmuting group members.

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.

queryGroupMemberMutedListByGroupID:config:callback:

queryGroupMemberMutedListByGroupID:config:callback:
- (void)queryGroupMemberMutedListByGroupID:(NSString *) groupID config:(ZIMGroupMemberMutedListQueryConfig) config callback:(ZIMGroupMemberMutedListQueriedCallback) callback;
Query the list of group muted members.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDNSString *The target group ID.
configZIMGroupMemberMutedListQueryConfigGroup muted member list query configuration.
callbackZIMGroupMemberMutedListQueriedCallbackCallback for the result of querying the group muted member list.

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.

queryGroupMessageReceiptReadMemberListByMessage:groupID:config:callback:

queryGroupMessageReceiptReadMemberListByMessage:groupID:config:callback:
deprecated
- (void)queryGroupMessageReceiptReadMemberListByMessage:(ZIMMessage) message groupID:(NSString *) groupID config:(ZIMGroupMessageReceiptMemberQueryConfig) config callback:(ZIMGroupMessageReceiptMemberListQueriedCallback) callback;
Query the list of group message read members.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe group message to query the read member list of.
groupIDNSString *The target group ID.
configZIMGroupMessageReceiptMemberQueryConfigGroup message receipt member query configuration.
callbackZIMGroupMessageReceiptMemberListQueriedCallbackCallback for the result of querying the group message 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 and UNKNOWN. If the user is not in the group, or has been kicked out of the group, the corresponding member list cannot be found.
Deprecated
This API was deprecated in 3.1.0. Please use [queryGroupMessageReceiptMemberList] instead.

queryGroupMessageReceiptUnreadMemberListByMessage:groupID:config:callback:

queryGroupMessageReceiptUnreadMemberListByMessage:groupID:config:callback:
deprecated
- (void)queryGroupMessageReceiptUnreadMemberListByMessage:(ZIMMessage) message groupID:(NSString *) groupID config:(ZIMGroupMessageReceiptMemberQueryConfig) config callback:(ZIMGroupMessageReceiptMemberListQueriedCallback) callback;
Query the list of group message unread members.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe group message to query the unread member list of.
groupIDNSString *The target group ID.
configZIMGroupMessageReceiptMemberQueryConfigGroup message receipt member query configuration.
callbackZIMGroupMessageReceiptMemberListQueriedCallbackCallback for the result of querying the group message unread 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.
Deprecated
This API was deprecated in 3.1.0. Please use [queryGroupMessageReceiptMemberList] instead.

queryGroupMessageReceiptMemberListByMessage:groupID:count:config:callback:

queryGroupMessageReceiptMemberListByMessage:groupID:count:config:callback:
- (void)queryGroupMessageReceiptMemberListByMessage:(ZIMMessage) message groupID:(NSString *) groupID count:(unsigned int) count config:(ZIMGroupMessageReceiptMemberListQueryConfig) config callback:(ZIMGroupMessageReceiptMemberListQueriedCallback) callback;
Query the receipt member list of a group message.
Declared in ZIM.h

Parameters

NameTypeDescription
messageZIMMessageThe group message to query the receipt member list of.
groupIDNSString *The target group ID.
countunsigned intThe number of members to query per page, up to 100.
configZIMGroupMessageReceiptMemberListQueryConfigQuery configuration for the group message receipt member list.
callbackZIMGroupMessageReceiptMemberListQueriedCallbackCallback for the result of querying the group message receipt member list.

Details

This method can query the specific unread member list, read member list, or delivered member list of a message sent by yourself in a group.

  • Use cases:Developers can use this method to query and display the specific receipt member lists of a message they sent, enabling the UI to separately show the unread, read, and delivered member lists for that message.
  • Caution:If you only need to query the receipt status of a message or just the read/unread count, use [queryMessageReceiptsInfo] instead.
  • Available since:3.1.0 and above.
  • Restrictions:Only supports querying messages sent by the local end, and the receipt status of the messages must not be NONE. If the user is not in the group, or has been kicked out of the group, the corresponding member list cannot be found.

searchLocalGroupsWithConfig:callback:

searchLocalGroupsWithConfig:callback:
- (void)searchLocalGroupsWithConfig:(ZIMGroupSearchConfig) config callback:(ZIMGroupsSearchedCallback) callback;
Search local groups.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMGroupSearchConfigConfiguration for searching groups.
callbackZIMGroupsSearchedCallbackCallback of the search groups result.

Details

This method is used to search for local groups.

  • Use cases:When you need to search for local groups by keywords or other criteria, you can call this interface to search.
  • When to call:After calling [login]
  • Related callbacks:[ZIMGroupsSearchedCallback].
  • Available since:2.9.0 and above.
  • Restrictions:Takes effect after login, becomes invalid after logout.

searchLocalGroupMembersByGroupID:config:callback:

searchLocalGroupMembersByGroupID:config:callback:
- (void)searchLocalGroupMembersByGroupID:(NSString *) groupID config:(ZIMGroupMemberSearchConfig) config callback:(ZIMGroupMembersSearchedCallback) callback;
Search local group members.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDNSString *Group ID of the joined group.
configZIMGroupMemberSearchConfigThe configuration for searching group members.
callbackZIMGroupMembersSearchedCallbackCallback of the search group members result.

Details

This method is used to search for group members.

  • Use cases:When you need to search for local group members by keywords or other criteria, you can call this interface to search.
  • Related callbacks:[ZIMGroupMembersSearchedCallback].
  • Available since:2.9.0 and above.
  • Restrictions:Takes effect after login, becomes invalid after logout.

sendGroupJoinApplicationToGroupID:config:callback:

sendGroupJoinApplicationToGroupID:config:callback:
- (void)sendGroupJoinApplicationToGroupID:(NSString *) groupID config:(ZIMGroupJoinApplicationSendConfig) config callback:(ZIMGroupJoinApplicationSentCallback) callback;
Send an application to join the group.
Declared in ZIM.h

Parameters

NameTypeDescription
groupIDNSString *The group ID to apply to join.
configZIMGroupJoinApplicationSendConfigGroup join application configuration.
callbackZIMGroupJoinApplicationSentCallbackCallback for the result of sending the group join application.

Details

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

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

acceptGroupJoinApplicationFromUserID:groupID:config:callback:

acceptGroupJoinApplicationFromUserID:groupID:config:callback:
- (void)acceptGroupJoinApplicationFromUserID:(NSString *) userID groupID:(NSString *) groupID config:(ZIMGroupJoinApplicationAcceptConfig) config callback:(ZIMGroupJoinApplicationAcceptedCallback) callback;
Accept an application to join the group.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDNSString *The user ID of the applicant.
groupIDNSString *The target group ID.
configZIMGroupJoinApplicationAcceptConfigConfiguration for accepting the group join application.
callbackZIMGroupJoinApplicationAcceptedCallbackCallback for the result of accepting the group join application.

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:The ZIM instance can be invoked after being created by [create] and logged in.
  • Available since:2.15.0 and above.

rejectGroupJoinApplicationFromUserID:groupID:config:callback:

rejectGroupJoinApplicationFromUserID:groupID:config:callback:
- (void)rejectGroupJoinApplicationFromUserID:(NSString *) userID groupID:(NSString *) groupID config:(ZIMGroupJoinApplicationRejectConfig) config callback:(ZIMGroupJoinApplicationRejectedCallback) callback;
Reject an application to join the group.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDNSString *The user ID of the applicant.
groupIDNSString *The target group ID.
configZIMGroupJoinApplicationRejectConfigConfiguration for rejecting the group join application.
callbackZIMGroupJoinApplicationRejectedCallbackCallback for the result of rejecting the group join application.

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:The ZIM instance can be invoked after being created by [create] and logged in.
  • Available since:2.15.0 and above.

sendGroupInviteApplicationsToUserIDs:groupID:config:callback:

sendGroupInviteApplicationsToUserIDs:groupID:config:callback:
- (void)sendGroupInviteApplicationsToUserIDs:(NSArray<NSString *> *) userIDs groupID:(NSString *) groupID config:(ZIMGroupInviteApplicationSendConfig) config callback:(ZIMGroupInviteApplicationsSentCallback) callback;
Send an application to invite the group.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *The list of user IDs to invite.
groupIDNSString *The target group ID.
configZIMGroupInviteApplicationSendConfigGroup invite application configuration.
callbackZIMGroupInviteApplicationsSentCallbackCallback for the result of sending group invite applications.

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:The ZIM instance can be invoked after being created by [create] and logged in.
  • Available since:2.15.0 and above.

acceptGroupInviteApplicationFromInviterUserID:groupID:config:callback:

acceptGroupInviteApplicationFromInviterUserID:groupID:config:callback:
- (void)acceptGroupInviteApplicationFromInviterUserID:(NSString *) inviterUserID groupID:(NSString *) groupID config:(ZIMGroupInviteApplicationAcceptConfig) config callback:(ZIMGroupInviteApplicationAcceptedCallback) callback;
Accept an application to invite to the group.
Declared in ZIM.h

Parameters

NameTypeDescription
inviterUserIDNSString *The user ID of the inviter.
groupIDNSString *The target group ID.
configZIMGroupInviteApplicationAcceptConfigConfiguration for accepting the group invite application.
callbackZIMGroupInviteApplicationAcceptedCallbackCallback for the result of accepting the group invite application.

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:The ZIM instance can be invoked after being created by [create] and logged in.
  • Available since:2.15.0 and above.

rejectGroupInviteApplicationFromInviterUserID:groupID:config:callback:

rejectGroupInviteApplicationFromInviterUserID:groupID:config:callback:
- (void)rejectGroupInviteApplicationFromInviterUserID:(NSString *) inviterUserID groupID:(NSString *) groupID config:(ZIMGroupInviteApplicationRejectConfig) config callback:(ZIMGroupInviteApplicationRejectedCallback) callback;
Reject an application to invite to the group.
Declared in ZIM.h

Parameters

NameTypeDescription
inviterUserIDNSString *The user ID of the inviter.
groupIDNSString *The target group ID.
configZIMGroupInviteApplicationRejectConfigConfiguration for rejecting the group invite application.
callbackZIMGroupInviteApplicationRejectedCallbackCallback for the result of rejecting the group invite application.

Details

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

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

queryGroupApplicationListWithConfig:callback:

queryGroupApplicationListWithConfig:callback:
- (void)queryGroupApplicationListWithConfig:(ZIMGroupApplicationListQueryConfig) config callback:(ZIMGroupApplicationListQueriedCallback) callback;
Query the group application list.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMGroupApplicationListQueryConfigGroup application list query configuration.
callbackZIMGroupApplicationListQueriedCallbackCallback for the result of querying the group application list.

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:The ZIM instance can be invoked after being created by [create] and logged in.
  • Available since:2.15.0 and above.

callInviteWithInvitees:config:callback:

callInviteWithInvitees:config:callback:
- (void)callInviteWithInvitees:(NSArray<NSString *> *) invitees config:(ZIMCallInviteConfig) config callback:(ZIMCallInvitationSentCallback) callback;
Initiate a call invitation.
Declared in ZIM.h

Parameters

NameTypeDescription
inviteesNSArray<NSString *> *The list of invitee user IDs.
configZIMCallInviteConfigCall invitation configuration.
callbackZIMCallInvitationSentCallbackCallback for the result of initiating a call invitation.

Details

When the caller initiates a call invitation, the called party can use [callAccept] to accept the call invitation or [callReject] to reject the invitation.

  • Use cases:When you need to initiate a call invitation, you can create a unique callid through this interface to maintain this call invitation.
  • When to call:It can be called after creating a ZIM instance through [create].
  • Caution:The call invitation has a timeout period, and the call invitation will end when the timeout period expires.
  • Related callbacks:[ZIMCallInvitationSentCallback].
  • Available since:2.0.0 and above.

callCancelWithInvitees:callID:config:callback:

callCancelWithInvitees:callID:config:callback:
- (void)callCancelWithInvitees:(NSArray<NSString *> *) invitees callID:(NSString *) callID config:(ZIMCallCancelConfig) config callback:(ZIMCallCancelSentCallback) callback;
Cancel the call invitation.
Declared in ZIM.h

Parameters

NameTypeDescription
inviteesNSArray<NSString *> *The list of invitee user IDs to cancel the invitation for.
callIDNSString *The call invitation ID to cancel.
configZIMCallCancelConfigCall cancel configuration.
callbackZIMCallCancelSentCallbackCallback for the result of canceling the call invitation.

Details

After the caller initiates a call invitation, the call invitation can be canceled through this interface before the timeout period.

  • Use cases:When you need to cancel the call invitation initiated before, you can cancel the call invitation through this interface.
  • When to call:It can be called after creating a ZIM instance through [create].
  • Caution:Canceling the call invitation after the timeout period of the call invitation expires will fail.
  • Related callbacks:[ZIMCallCancelSentCallback].
  • Available since:2.0.0 and above.

callAcceptWithCallID:config:callback:

callAcceptWithCallID:config:callback:
- (void)callAcceptWithCallID:(NSString *) callID config:(ZIMCallAcceptConfig) config callback:(ZIMCallAcceptanceSentCallback) callback;
Accept the call invitation.
Declared in ZIM.h

Parameters

NameTypeDescription
callIDNSString *The call invitation ID to accept.
configZIMCallAcceptConfigCall accept configuration.
callbackZIMCallAcceptanceSentCallbackCallback to accept call invitation.

Details

When the calling party initiates a call invitation, the called party can accept the call invitation through this interface.

  • Use cases:When you need to accept the call invitation initiated earlier, you can accept the call invitation through this interface.
  • When to call:It can be called after creating a ZIM instance through [create].
  • Caution:The callee will fail to accept an uninvited callid.
  • Related callbacks:[ZIMCallAcceptanceSentCallback].
  • Available since:2.0.0 and above.

callRejectWithCallID:config:callback:

callRejectWithCallID:config:callback:
- (void)callRejectWithCallID:(NSString *) callID config:(ZIMCallRejectConfig) config callback:(ZIMCallRejectionSentCallback) callback;
Reject the call invitation.
Declared in ZIM.h

Parameters

NameTypeDescription
callIDNSString *The ID of the call invitation to be rejected.
configZIMCallRejectConfigRelated configuration for rejecting call invitations.
callbackZIMCallRejectionSentCallbackCallback for rejecting call invitations.

Details

When the calling party initiates a call invitation, the called party can reject the call invitation through this interface.

  • Use cases:When you need to reject the call invitation initiated earlier, you can use this interface to reject the call invitation.
  • When to call:It can be called after creating a ZIM instance through [create].
  • Caution:The callee will fail to reject the uninvited callid.
  • Related callbacks:[ZIMCallRejectionSentCallback].
  • Available since:2.0.0 and above.

callingInviteWithInvitees:callID:config:callback:

callingInviteWithInvitees:callID:config:callback:
- (void)callingInviteWithInvitees:(NSArray<NSString *> *) invitees callID:(NSString *) callID config:(ZIMCallingInviteConfig) config callback:(ZIMCallingInvitationSentCallback) callback;
Invite other users to join the call invitation.
Declared in ZIM.h

Parameters

NameTypeDescription
inviteesNSArray<NSString *> *The list of user IDs to invite into the call.
callIDNSString *The current call invitation ID.
configZIMCallingInviteConfigConfiguration for inviting during an active call.
callbackZIMCallingInvitationSentCallbackCallback for the result of inviting other users to join the call.

Details

In the advanced mode, when the master calls the call invitation, users in the call can continue to invite other users to join the call through the interface,Or after the called party accepts the advanced mode call invitation.

  • When to call:After calling [callInvite] to initiate a call invitation in advanced mode.
  • Caution: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].
  • Available since:2.9.0 and above.

callJoin:config:callback:

callJoin:config:callback:
- (void)callJoin:(NSString *) callID config:(ZIMCallJoinConfig) config callback:(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
callIDNSString *The call invitation ID to join.
configZIMCallJoinConfigCall join configuration.
callbackZIMCallJoinSentCallbackCallback for the result of joining the call.

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.

callQuit:config:callback:

callQuit:config:callback:
- (void)callQuit:(NSString *) callID config:(ZIMCallQuitConfig) config callback:(ZIMCallQuitSentCallback) callback;
Quit the current call invitation.
Declared in ZIM.h

Parameters

NameTypeDescription
callIDNSString *The call invitation ID to quit.
configZIMCallQuitConfigCall quit configuration.
callbackZIMCallQuitSentCallbackCallback for the result of quitting the call.

Details

When the Lord's call initiates the invitation and is called and accepts it, the current call can be exited through the interface.

  • When to call:It can be called after creating a ZIM instance through [create].
  • Caution:The callee will fail to quit the uninvited callid.
  • Related callbacks:[ZIMCallQuitSentCallback].
  • Available since:2.9.0 and above.

callEnd:config:callback:

callEnd:config:callback:
- (void)callEnd:(NSString *) callID config:(ZIMCallEndConfig) config callback:(ZIMCallEndSentCallback) callback;
End the call invitation.
Declared in ZIM.h

Parameters

NameTypeDescription
callIDNSString *The call invitation ID to end.
configZIMCallEndConfigCall end configuration.
callbackZIMCallEndSentCallbackCallback for the result of ending the call.

Details

End The call in advanced mode.

  • When to call:The call was in advanced mode and the user status was Accepted.
  • Caution: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].
  • Available since:2.9.0 and above.

queryCallInvitationListWithConfig:callback:

queryCallInvitationListWithConfig:callback:
- (void)queryCallInvitationListWithConfig:(ZIMCallInvitationQueryConfig) config callback:(ZIMCallInvitationListQueriedCallback) callback;
Query the call invitation list.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMCallInvitationQueryConfigCall invitation list query configuration.
callbackZIMCallInvitationListQueriedCallbackCallback for the result of querying the call invitation list.

Details

Users can call the call invitation list through the query.

  • Use cases:Users can use the query call invitation list for interface display or other functions.
  • When to call:Run [create] to create a ZIM instance, which can be invoked after login.
  • Related callbacks:[ZIMCallInvitationListQueriedCallback].
  • Available since:2.9.0 and above.

addFriendByUserID:config:callback:

addFriendByUserID:config:callback:
- (void)addFriendByUserID:(NSString *) userID config:(ZIMFriendAddConfig) config callback:(ZIMFriendAddedCallback) callback;
Add friends directly.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDNSString *The user ID to add as a friend.
configZIMFriendAddConfigFriend add configuration.
callbackZIMFriendAddedCallbackCallback for the result of adding a friend.

Details

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

  • When to call: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.

deleteFriendsByUserIDs:config:callback:

deleteFriendsByUserIDs:config:callback:
- (void)deleteFriendsByUserIDs:(NSArray<NSString *> *) userIDs config:(ZIMFriendDeleteConfig) config callback:(ZIMFriendsDeletedCallback) callback;
Delete friends.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *The list of friend user IDs to delete.
configZIMFriendDeleteConfigFriend delete configuration.
callbackZIMFriendsDeletedCallbackCallback for the result of deleting friends.

Details

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

  • When to call: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.

checkFriendsRelationByUserIDs:config:callback:

checkFriendsRelationByUserIDs:config:callback:
- (void)checkFriendsRelationByUserIDs:(NSArray<NSString *> *) userIDs config:(ZIMFriendRelationCheckConfig) config callback:(ZIMFriendsRelationCheckedCallback) callback;
Check friend relationships.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *The list of user IDs to check friend relationships with.
configZIMFriendRelationCheckConfigFriend relation check configuration.
callbackZIMFriendsRelationCheckedCallbackCallback for the result of checking friend relationships.

Details

Through this interface, you can check the friend relationship with the specified user.

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

updateFriendAlias:userID:callback:

updateFriendAlias:userID:callback:
- (void)updateFriendAlias:(NSString *) friendAlias userID:(NSString *) userID callback:(ZIMFriendAliasUpdatedCallback) callback;
Update friend alias.
Declared in ZIM.h

Parameters

NameTypeDescription
friendAliasNSString *The new friend alias.
userIDNSString *The user ID of the friend to update the alias for.
callbackZIMFriendAliasUpdatedCallbackCallback for the result of updating the friend alias.

Details

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

  • When to call: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.

updateFriendAttributes:userID:callback:

updateFriendAttributes:userID:callback:
- (void)updateFriendAttributes:(NSDictionary<NSString, NSString> *) friendAttributes userID:(NSString *) userID callback:(ZIMFriendAttributesUpdatedCallback) callback;
Update friend attributes.
Declared in ZIM.h

Parameters

NameTypeDescription
friendAttributesNSDictionary<NSString, NSString> *The friend attributes to update, in key-value pairs.
userIDNSString *The user ID of the friend to update attributes for.
callbackZIMFriendAttributesUpdatedCallbackCallback for the result of updating friend attributes.

Details

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

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

queryFriendsInfoByUserIDs:callback:

queryFriendsInfoByUserIDs:callback:
- (void)queryFriendsInfoByUserIDs:(NSArray<NSString *> *) userIDs callback:(ZIMFriendsInfoQueriedCallback) callback;
Query friend information in batches.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *The list of friend user IDs to query information for.
callbackZIMFriendsInfoQueriedCallbackCallback for the result of querying friend information.

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: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.

queryFriendListWithConfig:callback:

queryFriendListWithConfig:callback:
- (void)queryFriendListWithConfig:(ZIMFriendListQueryConfig) config callback:(ZIMFriendListQueriedCallback) callback;
Query the friends list.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMFriendListQueryConfigFriend list query configuration.
callbackZIMFriendListQueriedCallbackCallback for the 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:It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks:[ZIMFriendListQueriedResult].
  • Available since:2.14.0 or above.

searchLocalFriendsWithConfig:callback:

searchLocalFriendsWithConfig:callback:
- (void)searchLocalFriendsWithConfig:(ZIMFriendSearchConfig) config callback:(ZIMFriendsSearchedCallback) callback;
Search local friends.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMFriendSearchConfigFriend search configuration.
callbackZIMFriendsSearchedCallbackCallback for the result of searching local friends.

Details

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

  • When to call: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.

sendFriendApplicationToUserID:config:callback:

sendFriendApplicationToUserID:config:callback:
- (void)sendFriendApplicationToUserID:(NSString *) userID config:(ZIMFriendApplicationSendConfig) config callback:(ZIMFriendApplicationSentCallback) callback;
Send a friend application.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDNSString *The user ID to send the friend application to.
configZIMFriendApplicationSendConfigFriend application configuration.
callbackZIMFriendApplicationSentCallbackCallback for the result of sending the friend application.

Details

When the user needs to initiate a friend application, he can initiate a friend application to the other party through [sendFriendApplication].

  • Use cases:When you need to initiate a friend request for a user, you can call this interface.
  • When to call:It can be called after creating a ZIM instance through [create].
  • Related callbacks:[onFriendApplicationListChanged].
  • Available since:2.14.0 and above.

acceptFriendApplicationFromUserID:config:callback:

acceptFriendApplicationFromUserID:config:callback:
- (void)acceptFriendApplicationFromUserID:(NSString *) userID config:(ZIMFriendApplicationAcceptConfig) config callback:(ZIMFriendApplicationAcceptedCallback) callback;
Accept a friend application.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDNSString *The user ID of the friend application sender.
configZIMFriendApplicationAcceptConfigConfiguration for accepting the friend application.
callbackZIMFriendApplicationAcceptedCallbackCallback for the result of accepting the friend application.

Details

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

  • When to call: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.

rejectFriendApplicationFromUserID:config:callback:

rejectFriendApplicationFromUserID:config:callback:
- (void)rejectFriendApplicationFromUserID:(NSString *) userID config:(ZIMFriendApplicationRejectConfig) config callback:(ZIMFriendApplicationRejectedCallback) callback;
Reject a friend application.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDNSString *The user ID of the friend application sender.
configZIMFriendApplicationRejectConfigConfiguration for rejecting the friend application.
callbackZIMFriendApplicationRejectedCallbackCallback for the result of rejecting the friend application.

Details

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

  • When to call: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.

queryFriendApplicationListWithConfig:callback:

queryFriendApplicationListWithConfig:callback:
- (void)queryFriendApplicationListWithConfig:(ZIMFriendApplicationListQueryConfig) config callback:(ZIMFriendApplicationListQueriedCallback) callback;
Query the friend application list.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMFriendApplicationListQueryConfigFriend application list query configuration.
callbackZIMFriendApplicationListQueriedCallbackCallback for the result of querying 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: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.

addUsersToBlacklistWithUserIDs:callback:

addUsersToBlacklistWithUserIDs:callback:
- (void)addUsersToBlacklistWithUserIDs:(NSArray<NSString *> *) userIDs callback:(ZIMBlacklistUsersAddedCallback) callback;
Add users to the blacklist.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *The list of user IDs to add to the blacklist.
callbackZIMBlacklistUsersAddedCallbackCallback for the result 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:It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks:[ZIMBlacklistUsersAddedCallback].
  • Available since:2.13.0 or above.
  • Restrictions:The number of userID passed in at one time cannot exceed 20.

removeUsersFromBlacklistWithUserIDs:callback:

removeUsersFromBlacklistWithUserIDs:callback:
- (void)removeUsersFromBlacklistWithUserIDs:(NSArray<NSString *> *) userIDs callback:(ZIMBlacklistUsersRemovedCallback) callback;
Remove the user from the blacklist.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *The list of user IDs to remove from the blacklist.
callbackZIMBlacklistUsersRemovedCallbackCallback for the result of removing users from the blacklist.

Details

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

  • When to call:It is available only after calling [create] to create the instance and then calling [login] to login.
  • Related callbacks:[ZIMBlacklistUsersRemovedCallback].
  • Available since:2.13.0 or above.
  • Restrictions:The number of userID passed in at one time cannot exceed 20.

queryBlacklistWithConfig:callback:

queryBlacklistWithConfig:callback:
- (void)queryBlacklistWithConfig:(ZIMBlacklistQueryConfig) config callback:(ZIMBlacklistQueriedCallback) callback;
Query the blacklist.
Declared in ZIM.h

Parameters

NameTypeDescription
configZIMBlacklistQueryConfigBlacklist query configuration.
callbackZIMBlacklistQueriedCallbackCallback for the result of querying the blacklist.

Details

Query the blacklist.

  • When to call: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.

checkUserIsInBlacklistByUserID:callback:

checkUserIsInBlacklistByUserID:callback:
- (void)checkUserIsInBlacklistByUserID:(NSString *) userID callback:(ZIMBlacklistCheckedCallback) callback;
Check if the user is on the blacklist.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDNSString *The user ID to check whether it is on the blacklist.
callbackZIMBlacklistCheckedCallbackCallback for the result of checking if the user is on the blacklist.

Details

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

  • When to call: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.

createCommunityWithCommunityInfo:config:callback:

createCommunityWithCommunityInfo:config:callback:
- (void)createCommunityWithCommunityInfo:(ZIMCommunityInfo) communityInfo config:(ZIMCommunityCreateConfig) config callback:(ZIMCommunityCreatedCallback) callback;
Create a community.
Declared in ZIM.h

Parameters

NameTypeDescription
communityInfoZIMCommunityInfoInformation for the community to be created.
configZIMCommunityCreateConfigCreate the relevant configuration of the community.
callbackZIMCommunityCreatedCallbackCallback for the result of creating a community.

Details

Create a community-type group that supports massive members interacting simultaneously.

  • Use cases:Used to create a large-scale social group that supports up to 100,000 users chatting or interacting in the community at the same time.
  • Related callbacks:The result of creating the community is obtained through the [ZIMCommunityCreatedCallback] callback.
  • Available since:3.0.0.

dismissCommunityByCommunityID:callback:

dismissCommunityByCommunityID:callback:
- (void)dismissCommunityByCommunityID:(NSString *) communityID callback:(ZIMCommunityDismissedCallback) callback;
Dismiss a community.
Declared in ZIM.h

Parameters

NameTypeDescription
communityIDNSString *The ID of the community to dismiss.
callbackZIMCommunityDismissedCallbackCallback for the result of dismissing the community.

Details

After a community is created, the community owner can dismiss it through this interface.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Caution:Only the community owner can dismiss the community.
  • Related callbacks:The result of dismissing the community is obtained through the [ZIMCommunityDismissedCallback] callback.
  • Available since:3.0.0.

joinCommunityWithCommunityID:callback:

joinCommunityWithCommunityID:callback:
- (void)joinCommunityWithCommunityID:(NSString *) communityID callback:(ZIMCommunityJoinedCallback) callback;
Join a community.
Declared in ZIM.h

Parameters

NameTypeDescription
communityIDNSString *The community ID to join.
callbackZIMCommunityJoinedCallbackCallback for the result of joining the community.

Details

Users can join the specified community through this interface.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The result of joining the community is obtained through the [ZIMCommunityJoinedCallback] callback.
  • Available since:3.0.0.

leaveCommunityByCommunityID:callback:

leaveCommunityByCommunityID:callback:
- (void)leaveCommunityByCommunityID:(NSString *) communityID callback:(ZIMCommunityLeftCallback) callback;
Leave a community.
Declared in ZIM.h

Parameters

NameTypeDescription
communityIDNSString *The community ID to leave.
callbackZIMCommunityLeftCallbackCallback for the result of leaving the community.

Details

After a user joins a community, they can leave through this interface.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The result of leaving the community is obtained through the [ZIMCommunityLeftCallback] callback.
  • Available since:3.0.0.

inviteUsersIntoCommunityWithUserIDs:communityID:callback:

inviteUsersIntoCommunityWithUserIDs:communityID:callback:
- (void)inviteUsersIntoCommunityWithUserIDs:(NSArray<NSString *> *) userIDs communityID:(NSString *) communityID callback:(ZIMCommunityUsersInvitedCallback) callback;
Invite users into a community.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *The list of user IDs to invite.
communityIDNSString *The target community ID.
callbackZIMCommunityUsersInvitedCallbackCallback for the result of inviting users into the community.

Details

Invite specified users to join the community.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The result of the invitation is obtained through the [ZIMCommunityUsersInvitedCallback] callback.
  • Available since:3.0.0.

kickCommunityMembersByUserIDs:communityID:callback:

kickCommunityMembersByUserIDs:communityID:callback:
- (void)kickCommunityMembersByUserIDs:(NSArray<NSString *> *) userIDs communityID:(NSString *) communityID callback:(ZIMCommunityMembersKickedCallback) callback;
Kick members from a community.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *The list of user IDs to kick from the community.
communityIDNSString *The target community ID.
callbackZIMCommunityMembersKickedCallbackCallback for the result of kicking members from the community.

Details

Remove specified users from the community.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Caution:Only the community owner and administrators can call this.
  • Related callbacks:The result of kicking members is obtained through the [ZIMCommunityMembersKickedCallback] callback.
  • Available since:3.0.0.

queryCommunityListWithCount:config:callback:

queryCommunityListWithCount:config:callback:
- (void)queryCommunityListWithCount:(unsigned int) count config:(ZIMCommunityListQueryConfig) config callback:(ZIMCommunityListQueriedCallback) callback;
Query the community list.
Declared in ZIM.h

Parameters

NameTypeDescription
countunsigned intThe number of communities to query.
configZIMCommunityListQueryConfigCommunity list query configuration (optional).
callbackZIMCommunityListQueriedCallbackCallback for the result of querying the community list.

Details

Query the list of communities that the current user has joined.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The query result is obtained through the [ZIMCommunityListQueriedCallback] callback.
  • Available since:3.0.0.

updateCommunityName:communityID:callback:

updateCommunityName:communityID:callback:
- (void)updateCommunityName:(NSString *) communityName communityID:(NSString *) communityID callback:(ZIMCommunityNameUpdatedCallback) callback;
Update the community name.
Declared in ZIM.h

Parameters

NameTypeDescription
communityNameNSString *The new community name.
communityIDNSString *The target community ID.
callbackZIMCommunityNameUpdatedCallbackCallback for the result of updating the community name.

Details

Update the name of the specified community.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The update result is obtained through the [ZIMCommunityNameUpdatedCallback] callback.
  • Available since:3.0.0.

updateCommunityAvatarUrl:communityID:callback:

updateCommunityAvatarUrl:communityID:callback:
- (void)updateCommunityAvatarUrl:(NSString *) communityAvatarUrl communityID:(NSString *) communityID callback:(ZIMCommunityAvatarUrlUpdatedCallback) callback;
Update the community avatar URL.
Declared in ZIM.h

Parameters

NameTypeDescription
communityAvatarUrlNSString *The new community avatar URL.
communityIDNSString *The target community ID.
callbackZIMCommunityAvatarUrlUpdatedCallbackCallback for the result of updating the community avatar URL.

Details

Update the avatar URL of the specified community.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The update result is obtained through the [ZIMCommunityAvatarUrlUpdatedCallback] callback.
  • Available since:3.0.0.

updateCommunityNotice:communityID:callback:

updateCommunityNotice:communityID:callback:
- (void)updateCommunityNotice:(NSString *) communityNotice communityID:(NSString *) communityID callback:(ZIMCommunityNoticeUpdatedCallback) callback;
Update the community notice.
Declared in ZIM.h

Parameters

NameTypeDescription
communityNoticeNSString *The new community notice content.
communityIDNSString *The target community ID.
callbackZIMCommunityNoticeUpdatedCallbackCallback for the result of updating the community notice.

Details

Update the notice content of the specified community.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The update result is obtained through the [ZIMCommunityNoticeUpdatedCallback] callback.
  • Available since:3.0.0.

setCommunityAttributes:communityID:callback:

setCommunityAttributes:communityID:callback:
- (void)setCommunityAttributes:(NSDictionary<NSString, NSString> *) communityAttributes communityID:(NSString *) communityID callback:(ZIMCommunityAttributesOperatedCallback) callback;
Set community attributes.
Declared in ZIM.h

Parameters

NameTypeDescription
communityAttributesNSDictionary<NSString, NSString> *The community attributes to set, in key-value pairs.
communityIDNSString *The target community ID.
callbackZIMCommunityAttributesOperatedCallbackCallback for the result of setting community attributes.

Details

Set custom attributes for the specified community.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The result is obtained through the [ZIMCommunityAttributesOperatedCallback] callback.
  • Available since:3.0.0.

deleteCommunityAttributesByKeys:communityID:callback:

deleteCommunityAttributesByKeys:communityID:callback:
- (void)deleteCommunityAttributesByKeys:(NSArray<NSString *> *) keys communityID:(NSString *) communityID callback:(ZIMCommunityAttributesOperatedCallback) callback;
Delete community attributes.
Declared in ZIM.h

Parameters

NameTypeDescription
keysNSArray<NSString *> *The list of community attribute keys to delete.
communityIDNSString *The target community ID.
callbackZIMCommunityAttributesOperatedCallbackCallback for the result of deleting community attributes.

Details

Delete custom attributes of the specified community.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The deletion result is obtained through the [ZIMCommunityAttributesOperatedCallback] callback.
  • Available since:3.0.0.

setCommunityNotificationStatus:communityID:callback:

setCommunityNotificationStatus:communityID:callback:
- (void)setCommunityNotificationStatus:(ZIMCommunityMessageNotificationStatus) status communityID:(NSString *) communityID callback:(ZIMCommunityNotificationStatusSetCallback) callback;
Set the community notification status.
Declared in ZIM.h

Parameters

NameTypeDescription
statusZIMCommunityMessageNotificationStatusThe notification status to set.
communityIDNSString *The target community ID.
callbackZIMCommunityNotificationStatusSetCallbackCallback for the result of setting the community notification status.

Details

Set the message notification status (such as Do Not Disturb) for the current user in the specified community.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The result is obtained through the [ZIMCommunityNotificationStatusSetCallback] callback.
  • Available since:3.0.0.

queryCommunityInfoByCommunityID:callback:

queryCommunityInfoByCommunityID:callback:
- (void)queryCommunityInfoByCommunityID:(NSString *) communityID callback:(ZIMCommunityInfoQueriedCallback) callback;
Query community information.
Declared in ZIM.h

Parameters

NameTypeDescription
communityIDNSString *The community ID to query information for.
callbackZIMCommunityInfoQueriedCallbackCallback for the result of querying community information.

Details

Query the detailed information of the specified community.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The query result is obtained through the [ZIMCommunityInfoQueriedCallback] callback.
  • Available since:3.0.0.

updateCommunityMemberRole:forUserID:communityID:callback:

updateCommunityMemberRole:forUserID:communityID:callback:
- (void)updateCommunityMemberRole:(ZIMCommunityMemberRole) memberRole forUserID:(NSString *) forUserID communityID:(NSString *) communityID callback:(ZIMCommunityMemberRoleUpdatedCallback) callback;
Update a community member's role.
Declared in ZIM.h

Parameters

NameTypeDescription
memberRoleZIMCommunityMemberRoleThe role value to set for the member.
forUserIDNSString *The user ID of the target community member.
communityIDNSString *The target community ID.
callbackZIMCommunityMemberRoleUpdatedCallbackCallback for the result of updating the community member role.

Details

Update the role of the specified community member.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Caution:Only the community owner can call this.
  • Related callbacks:The update result is obtained through the [ZIMCommunityMemberRoleUpdatedCallback] callback.
  • Available since:3.0.0.

transferCommunityOwnerToUserID:communityID:callback:

transferCommunityOwnerToUserID:communityID:callback:
- (void)transferCommunityOwnerToUserID:(NSString *) toUserID communityID:(NSString *) communityID callback:(ZIMCommunityOwnerTransferredCallback) callback;
Transfer the community owner.
Declared in ZIM.h

Parameters

NameTypeDescription
toUserIDNSString *The user ID of the new community owner.
communityIDNSString *The target community ID.
callbackZIMCommunityOwnerTransferredCallbackCallback for the result of transferring the community owner.

Details

The community owner can transfer ownership to a specified user through this method.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Caution:Only the community owner can call this.
  • Related callbacks:The transfer result is obtained through the [ZIMCommunityOwnerTransferredCallback] callback.
  • Available since:3.0.0.

queryCommunityMemberListByCommunityID:count:config:callback:

queryCommunityMemberListByCommunityID:count:config:callback:
- (void)queryCommunityMemberListByCommunityID:(NSString *) communityID count:(unsigned int) count config:(ZIMCommunityMemberListQueryConfig) config callback:(ZIMCommunityMemberListQueriedCallback) callback;
Query the community member list.
Declared in ZIM.h

Parameters

NameTypeDescription
communityIDNSString *The community ID to query the member list for.
countunsigned intThe number of members to query.
configZIMCommunityMemberListQueryConfigCommunity member list query configuration (optional).
callbackZIMCommunityMemberListQueriedCallbackCallback for the result of querying the community member list.

Details

Query the member list of the specified community.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The query result is obtained through the [ZIMCommunityMemberListQueriedCallback] callback.
  • Available since:3.0.0.

queryCommunityMembersByUserIDs:communityID:callback:

queryCommunityMembersByUserIDs:communityID:callback:
- (void)queryCommunityMembersByUserIDs:(NSArray<NSString *> *) userIDs communityID:(NSString *) communityID callback:(ZIMCommunityMembersQueriedCallback) callback;
Query specific community members' information.
Declared in ZIM.h

Parameters

NameTypeDescription
userIDsNSArray<NSString *> *The list of user IDs to query information for.
communityIDNSString *The target community ID.
callbackZIMCommunityMembersQueriedCallbackCallback for the result of querying specific community members' information.

Details

Query the member information of specific users in the specified community.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The query result is obtained through the [ZIMCommunityMembersQueriedCallback] callback.
  • Available since:3.0.0.

createCommunityChannelWithChannelInfo:config:callback:

createCommunityChannelWithChannelInfo:config:callback:
- (void)createCommunityChannelWithChannelInfo:(ZIMCommunityChannelInfo) channelInfo config:(ZIMCommunityChannelCreateConfig) config callback:(ZIMCommunityChannelCreatedCallback) callback;
Create a community channel.
Declared in ZIM.h

Parameters

NameTypeDescription
channelInfoZIMCommunityChannelInfoInformation for the community channel to be created.
configZIMCommunityChannelCreateConfigCreate the relevant configuration of the community channel.
callbackZIMCommunityChannelCreatedCallbackCallback for the result of creating a community channel.

Details

Create a chat channel within a community. The current version only supports creating public channels.

  • Use cases:Used to distinguish different chat topics within a community, allowing community administrators to manage separately and gather users with the same interests under the same topic.
  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Caution:Only the community owner and community administrators can create channels in the community.
  • Available since:3.0.0.

dismissCommunityChannelByChannelID:communityID:callback:

dismissCommunityChannelByChannelID:communityID:callback:
- (void)dismissCommunityChannelByChannelID:(NSString *) channelID communityID:(NSString *) communityID callback:(ZIMCommunityChannelDismissedCallback) callback;
Dismiss a community channel.
Declared in ZIM.h

Parameters

NameTypeDescription
channelIDNSString *The channel ID to dismiss.
communityIDNSString *The target community ID.
callbackZIMCommunityChannelDismissedCallbackCallback for the result of dismissing the community channel.

Details

Dismiss the specified channel in the community.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The dismissal result is obtained through the [ZIMCommunityChannelDismissedCallback] callback.
  • Available since:3.0.0.

updateCommunityChannelName:channelID:communityID:callback:

updateCommunityChannelName:channelID:communityID:callback:
- (void)updateCommunityChannelName:(NSString *) channelName channelID:(NSString *) channelID communityID:(NSString *) communityID callback:(ZIMCommunityChannelNameUpdatedCallback) callback;
Update the community channel name.
Declared in ZIM.h

Parameters

NameTypeDescription
channelNameNSString *The new channel name.
channelIDNSString *The channel ID to update the name for.
communityIDNSString *The target community ID.
callbackZIMCommunityChannelNameUpdatedCallbackCallback for the result of updating the community channel name.

Details

Update the name of the specified community channel.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The update result is obtained through the [ZIMCommunityChannelNameUpdatedCallback] callback.
  • Available since:3.0.0.

updateCommunityChannelAvatarUrl:channelID:communityID:callback:

updateCommunityChannelAvatarUrl:channelID:communityID:callback:
- (void)updateCommunityChannelAvatarUrl:(NSString *) channelAvatarUrl channelID:(NSString *) channelID communityID:(NSString *) communityID callback:(ZIMCommunityChannelAvatarUrlUpdatedCallback) callback;
Update the community channel avatar URL.
Declared in ZIM.h

Parameters

NameTypeDescription
channelAvatarUrlNSString *The new channel avatar URL.
channelIDNSString *The channel ID to update the avatar URL for.
communityIDNSString *The target community ID.
callbackZIMCommunityChannelAvatarUrlUpdatedCallbackCallback for the result of updating the community channel avatar URL.

Details

Update the avatar URL of the specified community channel.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The update result is obtained through the [ZIMCommunityChannelAvatarUrlUpdatedCallback] callback.
  • Available since:3.0.0.

updateCommunityChannelNotice:channelID:communityID:callback:

updateCommunityChannelNotice:channelID:communityID:callback:
- (void)updateCommunityChannelNotice:(NSString *) channelNotice channelID:(NSString *) channelID communityID:(NSString *) communityID callback:(ZIMCommunityChannelNoticeUpdatedCallback) callback;
Update the community channel notice.
Declared in ZIM.h

Parameters

NameTypeDescription
channelNoticeNSString *The new channel notice content.
channelIDNSString *The channel ID to update the notice for.
communityIDNSString *The target community ID.
callbackZIMCommunityChannelNoticeUpdatedCallbackCallback for the result of updating the community channel notice.

Details

Update the notice content of the specified community channel.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The update result is obtained through the [ZIMCommunityChannelNoticeUpdatedCallback] callback.
  • Available since:3.0.0.

setCommunityChannelAttributes:channelID:communityID:callback:

setCommunityChannelAttributes:channelID:communityID:callback:
- (void)setCommunityChannelAttributes:(NSDictionary<NSString, NSString> *) channelAttributes channelID:(NSString *) channelID communityID:(NSString *) communityID callback:(ZIMCommunityChannelAttributesOperatedCallback) callback;
Set community channel attributes.
Declared in ZIM.h

Parameters

NameTypeDescription
channelAttributesNSDictionary<NSString, NSString> *The channel attributes to set, in key-value pairs.
channelIDNSString *The target channel ID.
communityIDNSString *The target community ID.
callbackZIMCommunityChannelAttributesOperatedCallbackCallback for the result of setting community channel attributes.

Details

Set custom attributes for the specified community channel.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The result is obtained through the [ZIMCommunityChannelAttributesOperatedCallback] callback.
  • Available since:3.0.0.

deleteCommunityChannelAttributesByKeys:channelID:communityID:callback:

deleteCommunityChannelAttributesByKeys:channelID:communityID:callback:
- (void)deleteCommunityChannelAttributesByKeys:(NSArray<NSString *> *) keys channelID:(NSString *) channelID communityID:(NSString *) communityID callback:(ZIMCommunityChannelAttributesOperatedCallback) callback;
Delete community channel attributes.
Declared in ZIM.h

Parameters

NameTypeDescription
keysNSArray<NSString *> *The list of channel attribute keys to delete.
channelIDNSString *The target channel ID.
communityIDNSString *The target community ID.
callbackZIMCommunityChannelAttributesOperatedCallbackCallback for the result of deleting community channel attributes.

Details

Delete custom attributes of the specified community channel.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The deletion result is obtained through the [ZIMCommunityChannelAttributesOperatedCallback] callback.
  • Available since:3.0.0.

queryCommunityChannelsInfoByChannelIDs:communityID:callback:

queryCommunityChannelsInfoByChannelIDs:communityID:callback:
- (void)queryCommunityChannelsInfoByChannelIDs:(NSArray<NSString *> *) channelIDs communityID:(NSString *) communityID callback:(ZIMCommunityChannelsInfoQueriedCallback) callback;
Query community channel information.
Declared in ZIM.h

Parameters

NameTypeDescription
channelIDsNSArray<NSString *> *The list of channel IDs to query information for.
communityIDNSString *The target community ID.
callbackZIMCommunityChannelsInfoQueriedCallbackCallback for the result of querying community channel information.

Details

Query the detailed information of multiple channels in the specified community.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The query result is obtained through the [ZIMCommunityChannelsInfoQueriedCallback] callback.
  • Available since:3.0.0.

queryCommunityChannelListByCommunityID:count:config:callback:

queryCommunityChannelListByCommunityID:count:config:callback:
- (void)queryCommunityChannelListByCommunityID:(NSString *) communityID count:(unsigned int) count config:(ZIMCommunityChannelListQueryConfig) config callback:(ZIMCommunityChannelListQueriedCallback) callback;
Query the community channel list.
Declared in ZIM.h

Parameters

NameTypeDescription
communityIDNSString *The community ID to query the channel list for.
countunsigned intThe number of channels to query.
configZIMCommunityChannelListQueryConfigCommunity channel list query configuration (optional).
callbackZIMCommunityChannelListQueriedCallbackCallback for the result of querying the community channel list.

Details

Query the channel list of the specified community.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The query result is obtained through the [ZIMCommunityChannelListQueriedCallback] callback.
  • Available since:3.0.0.

muteCommunityChannels:channelIDs:communityID:config:callback:

muteCommunityChannels:channelIDs:communityID:config:callback:
- (void)muteCommunityChannels:(BOOL) isMute channelIDs:(NSArray<NSString *> *) channelIDs communityID:(NSString *) communityID config:(ZIMCommunityChannelMuteConfig) config callback:(ZIMCommunityChannelsMutedCallback) callback;
Mute community channels.
Declared in ZIM.h

Parameters

NameTypeDescription
isMuteBOOLWhether to mute. true means mute, false means unmute.
channelIDsNSArray<NSString *> *The list of channel IDs to mute/unmute.
communityIDNSString *The target community ID.
configZIMCommunityChannelMuteConfigCommunity channel mute configuration (optional).
callbackZIMCommunityChannelsMutedCallbackCallback for the result of muting community channels.

Details

Mute or unmute channels in the specified community.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Related callbacks:The operation result is obtained through the [ZIMCommunityChannelsMutedCallback] callback.
  • Available since:3.0.0.

muteCommunityMembers:userIDs:communityID:config:callback:

muteCommunityMembers:userIDs:communityID:config:callback:
- (void)muteCommunityMembers:(BOOL) isMute userIDs:(NSArray<NSString *> *) userIDs communityID:(NSString *) communityID config:(ZIMCommunityMemberMuteConfig) config callback:(ZIMCommunityMembersMutedCallback) callback;
Mute community members.
Declared in ZIM.h

Parameters

NameTypeDescription
isMuteBOOLWhether to mute. true means mute, false means unmute.
userIDsNSArray<NSString *> *The list of user IDs to mute/unmute.
communityIDNSString *The target community ID.
configZIMCommunityMemberMuteConfigCommunity member mute configuration (optional).
callbackZIMCommunityMembersMutedCallbackCallback for the result of muting community members.

Details

Mute or unmute members in the specified community.

  • When to call:Can be called after creating a ZIM instance via [create] and logging in.
  • Caution:Only the community owner and administrators can call this.
  • Related callbacks:The operation result is obtained through the [ZIMCommunityMembersMutedCallback] callback.
  • Available since:3.0.0.

ZIMEventHandler

Details

ZIM SDK event handler class.

Declared in ZIMEventHandler.h

Methods

zim:errorInfo:

zim:errorInfo:
- (void)zim:(ZIM) zim errorInfo:(ZIMError) errorInfo;
The callback for error information.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
errorInfoZIMErrorThe error information

Details

When an exception occurs in the SDK, the callback will prompt detailed exception information.

  • Use cases:It is recommended that developers, after integrating the SDK, listen to this callback during the debugging phase and print error information to the console to promptly identify and fix errors that occur during development.
  • Triggered when:This callback is triggered when an error occurs internally in the SDK. For error codes, refer to the official website documentation.
  • Available since:1.0.0 and above.

zim:experimentalEventReceived:

zim:experimentalEventReceived:
- (void)zim:(ZIM) zim experimentalEventReceived:(NSString *) content;
Experimental API callback.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
contentNSString *Callback content in JSON string format.

Details

Receive experimental API callbacks. Please use this feature with the assistance of ZEGO technical support.

  • Available since:2.28.0 and above.

zim:tokenWillExpire:

zim:tokenWillExpire:
- (void)zim:(ZIM) zim tokenWillExpire:(unsigned int) second;
A reminder callback that the token is about to expire.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
secondunsigned intThe remaining second before the token expires.

Details

When developers use authentication tokens for login, the token update logic can be handled through this event when the token is about to expire.

  • Triggered when:When the authentication token has only 30 seconds remaining, the SDK will trigger this callback to notify developers to update the authentication token. If the token passed during [login] has less than 30 seconds of validity, this callback will be triggered immediately after [login] succeeds.
  • Caution:When this callback is received, developers should promptly call [renewToken] to update the token.
  • References:For details, please refer to the authentication token generation guide at https://doc-zh.zego.im/article/11617 .
  • Available since:1.1.0 and above.

zim:connectionStateChanged:event:extendedData:

zim:connectionStateChanged:event:extendedData:
- (void)zim:(ZIM) zim connectionStateChanged:(ZIMConnectionState) state event:(ZIMConnectionEvent) event extendedData:(NSDictionary *) extendedData;
The event callback when the connection state changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMzim ZIM instance.
stateZIMConnectionStateThe current connection state after changed.
eventZIMConnectionEventThe event that caused the connection state to change.
extendedDataNSDictionary *Extra information when the event occurs, a standard JSON string.

Details

When the connection state changes, this callback notifies the user of the current state and event.

  • Use cases:When you need to monitor the connection state and the events that cause connection state changes, you can use [ZIMConnectionState] and [ZIMConnectionEvent] in this callback to implement different business logic.
  • Triggered when:This callback is triggered when the SDK performs login, logout, or when the network is temporarily interrupted.
  • Caution:In the case of connection state changes caused by general network exceptions, developers do not need to perform reconnection themselves. The SDK will continuously attempt to reconnect until successful.
  • Available since:1.1.0 and above.

zim:userInfoUpdated:

zim:userInfoUpdated:
- (void)zim:(ZIM) zim userInfoUpdated:(ZIMUserFullInfo) info;
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.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infoZIMUserFullInfoThe user info after updating.

Details

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

  • Triggered when:When the current user on another device modifies their own user information, this callback is triggered on all currently online devices.
  • Available since:2.11.0 and above.

zim:userRuleUpdated:

zim:userRuleUpdated:
- (void)zim:(ZIM) zim userRuleUpdated:(ZIMUserRule) userRule;
Triggered when the user rule changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
userRuleZIMUserRuleThe user rule after updating.

Details

When the current user changes user rules via [updateUserOfflinePushRule], this callback notifies other online multi-device devices.

  • Triggered when:When the current user on another device modifies their own user rules, this callback is triggered on all currently online devices.
  • Available since:2.15.0 and above.

zim:userStatusUpdated:

zim:userStatusUpdated:
- (void)zim:(ZIM) zim userStatusUpdated:(NSArray<ZIMUserStatus *> *) userStatusList;
User online status change notification.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
userStatusListNSArray<ZIMUserStatus *> *The user status list after updating.

Details

Event notification when the online status of subscribed users changes.

  • Use cases:When your business needs to monitor the online status of certain users, such as displaying online group members, subscribe to those users via [subscribeUsersStatus]. Changes to those users' online status and platform list during the subscription period will be notified through this callback.
  • Triggered when:After the current user first subscribes to a target user, this event is triggered when the target user is first added to the subscription list, or when the subscribed user's online status or online platform list changes. Additionally, if the current user has multi-device login enabled and the online platform changes, this callback will also be triggered.
  • Caution:When the [onUserStatusUpdated] callback returns the current user's userStatus information, the onlineStatus will be [ZIMUserOnlineStatusUnknown] and lastUpdateTime will be 0, which does not accurately reflect the online status. Please use [onConnectionStateChanged] to map the current user's online status.
  • Available since:2.18.0 and above.

zim:conversationChanged:

zim:conversationChanged:
- (void)zim:(ZIM) zim conversationChanged:(NSArray<ZIMConversationChangeInfo *> *) infoList;
Received notification callback for session update.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infoListNSArray<ZIMConversationChangeInfo *> *Changed information about the conversation.

Details

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

  • Triggered when: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:Through [sendMessage], [deleteConversation] [deleteMessages], [clearConversationUnreadMessageCount] trigger.
  • Available since:2.0.0 and above.

zim:conversationTotalUnreadMessageCountUpdated:

zim:conversationTotalUnreadMessageCountUpdated:
- (void)zim:(ZIM) zim conversationTotalUnreadMessageCountUpdated:(unsigned int) totalUnreadMessageCount;
Received notification callback for session update.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
totalUnreadMessageCountunsigned intTotal number of unread messages.

Details

This callback returns the total number of unread messages across all conversations.

  • Triggered when:Immediately after the SDK logs in, a notification of the current total unread message count is triggered. It is also triggered when new messages are received or when the unread count of a conversation is cleared.
  • Caution:If a conversation is set to do-not-disturb mode, changes to its unread count will not drive changes to the total unread count.
  • Available since:2.0.0 and above.

zim:conversationMessageReceiptChanged:

zim:conversationMessageReceiptChanged:
- (void)zim:(ZIM) zim conversationMessageReceiptChanged:(NSArray<ZIMMessageReceiptInfo *> *) infos;
Received notification callback when the message receiver has read this receipt message.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infosNSArray<ZIMMessageReceiptInfo *> *Receipt information.

Details

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

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

zim:conversationsAllDeleted:

zim:conversationsAllDeleted:
- (void)zim:(ZIM) zim conversationsAllDeleted:(ZIMConversationsAllDeletedInfo) info;
When multiple login ends delete all sessions, the local end triggers the callback to notify the local end that all sessions are deleted.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infoZIMConversationsAllDeletedInfoInformation about deleted conversations.

Details

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

  • Triggered when:When another end clears all unread sessions, the local end triggers a notification.
  • Caution:After calling the SDK [deleteAllConversations] interface to delete all conversations, [onConversationChanged] will not be triggered. It is recommended that developers, upon receiving this callback, call [queryConversationList] again to sync the conversation list UI to the latest state.
  • Related APIs:[deleteAllConversations].
  • Available since:2.12.0 and above.

zim:conversationSyncStateChanged:

zim:conversationSyncStateChanged:
- (void)zim:(ZIM) zim conversationSyncStateChanged:(ZIMConversationSyncState) state;
Notification of synchronization status change events between the conversation list and the server
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
stateZIMConversationSyncStateSync status

Details

After the SDK first logs in and starts the process of syncing conversations from the server, this callback is triggered to return notifications of conversation updates when the process completes or fails.

  • Triggered when:This callback is triggered when the SDK performs the sync conversation list operation after the first login or after reconnecting from a network disconnect.
  • Caution:Even if the conversation list does not need to be synced, the SDK will still trigger the sync completion callback so that developers can display or dismiss UI loading indicators.
  • Available since:2.21.0 and above.

zim:peerMessageReceived:info:fromUserID:

zim:peerMessageReceived:info:fromUserID:
deprecated
- (void)zim:(ZIM) zim peerMessageReceived:(NSArray<ZIMMessage *> *) messageList info:(ZIMMessageReceivedInfo) info fromUserID:(NSString *) fromUserID;
The callback for receiving peer-to-peer message.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
messageListNSArray<ZIMMessage *> *List of received messages.
infoZIMMessageReceivedInfoThe message receive extra information.
fromUserIDNSString *The user ID of the message source.

Details

When online, users can receive online peer-to-peer messages through this callback. After re-logging in to the ZIM SDK, users can receive all peer-to-peer messages received during the offline period (up to 7 days) through this callback.

  • Triggered when:This callback is triggered when a peer-to-peer message sent by another user is received.
  • Related APIs:[sendMessage]
  • Available since:2.18.0 and above.
Deprecated
This API was deprecated in version 3.0.0. Please use [onMessageReceived] instead.

zim:roomMessageReceived:info:fromRoomID:

zim:roomMessageReceived:info:fromRoomID:
deprecated
- (void)zim:(ZIM) zim roomMessageReceived:(NSArray<ZIMMessage *> *) messageList info:(ZIMMessageReceivedInfo) info fromRoomID:(NSString *) fromRoomID;
The callback for receiving room message.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
messageListNSArray<ZIMMessage *> *List of received messages.
infoZIMMessageReceivedInfoThe message receive extra information.
fromRoomIDNSString *The room ID of the message source.

Details

When online, users can receive online room messages through this callback. After recovering from offline to online, if the user is still in the room, they can receive all room messages from the offline period through this callback (this capability requires the room offline message storage feature to be enabled).

  • Triggered when:This callback is triggered when the current user is in a room and other users in the same room send messages to the room the current user has joined or created.
  • Related APIs:[sendMessage]
  • Available since:2.18.0 and above.
Deprecated
This API was deprecated in version 3.0.0. Please use [onMessageReceived] instead.

zim:groupMessageReceived:info:fromGroupID:

zim:groupMessageReceived:info:fromGroupID:
deprecated
- (void)zim:(ZIM) zim groupMessageReceived:(NSArray<ZIMMessage *> *) messageList info:(ZIMMessageReceivedInfo) info fromGroupID:(NSString *) fromGroupID;
The callback for receiving group message.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
messageListNSArray<ZIMMessage *> *List of received messages.
infoZIMMessageReceivedInfoThe message receive extra information.
fromGroupIDNSString *The group ID of the message source.

Details

When online, users can receive online group messages through this callback. After re-logging in to the ZIM SDK, users can receive all group chat messages received during the offline period (up to 7 days) through this callback.

  • Triggered when:This callback is triggered when group members in the same group send messages.
  • Related APIs:[sendMessage]
  • Available since:2.18.0 and above.
Deprecated
This API was deprecated in version 3.0.0. Please use [onMessageReceived] instead.

zim:messageReceivedWithResult:

zim:messageReceivedWithResult:
- (void)zim:(ZIM) zim messageReceivedWithResult:(ZIMMessageReceivedEventResult) result;
The callback for receiving message.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
resultZIMMessageReceivedEventResultThe receive group message event callback result

Details

When online, users can receive online messages through this callback. After re-logging in to the ZIM SDK, users can receive all single chat and group chat messages received during the offline period (up to 7 days); if the room has the offline message storage feature enabled, room messages can also be received.

  • Triggered when:This callback is triggered when a peer-to-peer message, room message, group message, or community channel message is received.
  • Related APIs:[sendMessage]
  • Available since:3.0.0 and above.

zim:broadcastMessageReceived:

zim:broadcastMessageReceived:
- (void)zim:(ZIM) zim broadcastMessageReceived:(ZIMMessage) message;
The callback for receiving broadcast message.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
messageZIMMessageReceived broadcast message.

Details

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

  • Triggered when:This callback is received after logging in to the ZIM service and the server call the [SendMessageToAllUsers] interface to send a message.
  • Available since:2.10.0 or later.

zim:messageSentStatusChanged:

zim:messageSentStatusChanged:
- (void)zim:(ZIM) zim messageSentStatusChanged:(NSArray<ZIMMessageSentStatusChangeInfo *> *) infos;
The callback for message sent status changed.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infosNSArray<ZIMMessageSentStatusChangeInfo *> *List of message sent status change information.

Details

This callback is received when the message sending status changes.

  • Triggered when:When the current user sends a message and the message status changes from sending to sent successfully or send failed, this callback will be triggered.
  • Caution:Only the device user who actually sends the message can receive this callback. Other devices in a multi-device login scenario will not receive this callback.
  • Related APIs:[sendMessage]
  • Available since:2.6.0 and above.

zim:messageReceiptChanged:

zim:messageReceiptChanged:
- (void)zim:(ZIM) zim messageReceiptChanged:(NSArray<ZIMMessageReceiptInfo *> *) infos;
Received notification callback when the message receiver confirms that the message has been read.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infosNSArray<ZIMMessageReceiptInfo *> *List of message receipt change information.

Details

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

  • Triggered when: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.

zim:messageRevokeReceived:

zim:messageRevokeReceived:
- (void)zim:(ZIM) zim messageRevokeReceived:(NSArray<ZIMRevokeMessage *> *) messageList;
Received notification callback when some one else sends a message and then revoke a message sent by themselves.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
messageListNSArray<ZIMRevokeMessage *> *List of message revoke information.

Details

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

  • Triggered when:This callback occurs when a ZIM instance is created with [create] and the other user revoke a message.
  • Related APIs:You can revoke message to other members via [revokeMessage].
  • Available since:2.5.0 and above.

zim:messageReactionsChanged:

zim:messageReactionsChanged:
deprecated
- (void)zim:(ZIM) zim messageReactionsChanged:(NSArray<ZIMMessageReaction *> *) reactions;
The callback is received when reactions change
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
reactionsNSArray<ZIMMessageReaction *> *List of message reaction information.
  • Triggered when:This callback can be registered after the ZIM instance is created by [create] and before login.
  • Triggered when:After other users add or delete reactions to messages in private or group chats.
  • Related APIs:[addMessageReaction]、[deleteMessageReaction]
  • Available since:2.10.0 or later.
Deprecated
This API was deprecated in version 2.28.0. Please use the other overloaded method with the same name, [onMessageReactionsChanged], instead.

zim:messageReactionsChangedWithResult:

zim:messageReactionsChangedWithResult:
- (void)zim:(ZIM) zim messageReactionsChangedWithResult:(ZIMMessageReactionsChangedEventResult) result;
The callback is received when reactions change
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
resultZIMMessageReactionsChangedEventResultThe message reaction change event callback result

Details

This callback is received when the reaction types in a message increase or decrease, or when the user count and count of a specific reaction change.

  • Triggered when:This callback is triggered when the current user has already received a message in the conversation and the reaction content of the message changes.
  • Related APIs:[addMessageReaction], [deleteMessageReaction]
  • Available since:2.28.0 and above.

zim:messageDeleted:

zim:messageDeleted:
- (void)zim:(ZIM) zim messageDeleted:(ZIMMessageDeletedInfo) deletedInfo;
The callback is received when a message is deleted.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
deletedInfoZIMMessageDeletedInfoInformation about deleted messages.

Details

In multi-device login scenarios, after the user deletes server-side messages on device A, other online multi-device devices will receive this callback.

  • Triggered when:When another device of the current user in a multi-device online login performs message deletion, the online user on the current device will trigger this callback.
  • Caution:When other users in a conversation delete messages, other users will not receive this callback. This callback only takes effect for the user who performs the deletion.
  • Related APIs:[deleteMessages], [deleteAllMessage], [deleteAllConversationMessages]
  • Available since:2.11.0 and above.

zim:messageRepliedInfoChanged:

zim:messageRepliedInfoChanged:
- (void)zim:(ZIM) zim messageRepliedInfoChanged:(NSArray<ZIMMessage *> *) messageList;
The callback is received when the message replied information changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
messageListNSArray<ZIMMessage *> *List of message information.

Details

Users in the conversation will receive this callback when the source message referenced by a reply message is deleted, revoked, or its content is edited.

  • Triggered when:This callback is triggered when the current user has already received a message in the conversation and the reply content carried by that message changes.
  • Use cases:This allows developers to be notified in advance of source message status changes for quoted messages in the chat view before the reply source message is fetched, enabling timely UI refresh.
  • Related APIs:[deleteMessages], [revokeMessage], [editMessage]
  • Available since:2.17.0 and above.

zim:messageRepliedCountChanged:

zim:messageRepliedCountChanged:
- (void)zim:(ZIM) zim messageRepliedCountChanged:(NSArray<ZIMMessageRootRepliedCountInfo *> *) infos;
The callback is received when the message replied count changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infosNSArray<ZIMMessageRootRepliedCountInfo *> *List of message root reply count change information.

Details

When messages continue to be replied to in the same reply chain, changes to the reply count of the source message are notified through this callback.

  • Triggered when:This callback is triggered when the current user has received the source message and the message is replied to.
  • Related APIs:[replyMessage].
  • Available since:2.17.0 and above.

zim:messageEdited:

zim:messageEdited:
- (void)zim:(ZIM) zim messageEdited:(NSArray<ZIMMessage *> *) messageList;
The callback is received when a message is edited.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
messageListNSArray<ZIMMessage *> *The message list.

Details

Users in the conversation will receive this callback when a message is edited.

  • Triggered when:This callback is triggered when the current user has already received a message in the conversation and that message is subsequently edited.
  • Related APIs:[editMessage].
  • Available since:2.20.0 and above.

zim:messagePinStatusChanged:

zim:messagePinStatusChanged:
- (void)zim:(ZIM) zim messagePinStatusChanged:(NSArray<ZIMMessagePinStatusChangeInfo *> *) changeInfoList;
The callback is received when a message is pinned.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
changeInfoListNSArray<ZIMMessagePinStatusChangeInfo *> *The message list.

Details

This callback is received when a message in the conversation is successfully pinned or unpinned, or when the pinned message information changes.

  • Triggered when:This callback is triggered when a message in the conversation is successfully pinned or unpinned, or when the pinned message information changes.
  • Related APIs:[pinMessage].
  • Available since:2.25.0 and above.

zim:roomStateChanged:event:extendedData:roomID:

zim:roomStateChanged:event:extendedData:roomID:
- (void)zim:(ZIM) zim roomStateChanged:(ZIMRoomState) state event:(ZIMRoomEvent) event extendedData:(NSDictionary *) extendedData roomID:(NSString *) roomID;
The event callback when the room connection status changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
stateZIMRoomStateRoom state.
eventZIMRoomEventRoom event.
extendedDataNSDictionary *Extended data.
roomIDNSString *Room ID.

Details

Event callback when the room connection status changes. It is recommended that developers always listen to this callback to properly manage the room lifecycle.

  • Triggered when:This callback is triggered when the room connection status changes, such as when entering or leaving a room, a temporary network interruption, or a room connection timeout.
  • Caution:Since the SDK does not perform unlimited reconnection for room connections, developers need to selectively perform limited reconnection according to their own business requirements.
  • Referenceshttps://doc-zh.zego.im/faq/zim-reconnect-support

zim:roomMemberJoined:roomID:

zim:roomMemberJoined:roomID:
- (void)zim:(ZIM) zim roomMemberJoined:(NSArray<ZIMUserInfo *> *) memberList roomID:(NSString *) roomID;
Callback when other members join the room.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
memberListNSArray<ZIMUserInfo *> *List of members who joined the room.
roomIDNSString *The ID of the room where this event occurred.

Details

After joining a room, this callback will be triggered when other members also join the room.

  • Triggered when:This callback is triggered when the current user is online in the room and other users join the room.
  • Caution:If the current user is temporarily offline due to network issues when other users enter the room, this callback will not be re-sent after reconnection. Developers can use [queryRoomMemberList] to get the latest room member list at that time.
  • Related APIs:[enterRoom], [joinRoom].
  • Available since:1.1.0 and above.

zim:roomMemberLeft:roomID:

zim:roomMemberLeft:roomID:
- (void)zim:(ZIM) zim roomMemberLeft:(NSArray<ZIMUserInfo *> *) memberList roomID:(NSString *) roomID;
Callback when other members leave the room.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
memberListNSArray<ZIMUserInfo *> *List of members who left the room.
roomIDNSString *The ID of the room where this event occurred.

Details

After joining a room, this callback will be triggered when other members leave the room.

  • Triggered when:This callback is triggered when the current user is online in the room and other users leave the room.
  • Caution:If the current user is temporarily offline due to network issues when other users leave the room, this callback will not be re-sent after reconnection. Developers can use [queryRoomMemberList] to get the latest room member list at that time.
  • Related APIs:[leaveRoom].
  • Available since:1.1.0 and above.

zim:roomAttributesUpdated:roomID:

zim:roomAttributesUpdated:roomID:
- (void)zim:(ZIM) zim roomAttributesUpdated:(ZIMRoomAttributesUpdateInfo) info roomID:(NSString *) roomID;
Event callback when the room attributes changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infoZIMRoomAttributesUpdateInfoRoom attribute change information
roomIDNSString *The ID of the room where this event occurred.

Details

When the room attributes in the room change, this callback notifies the users.

  • Triggered when:When first joining a room, if there are room attributes in the room at that time, a callback is triggered once, which developers can use to save as initial attribute values. This callback is also triggered when other users in the room change room attributes (triggered when the current user is online or successfully reconnects after a brief offline period).
  • Use cases:In voice chat room scenarios, room attributes can be used to manage microphone seat information.
  • Related APIs:[setRoomAttributes], [deleteRoomAttributes].
  • Available since:1.3.0 and above.

zim:roomAttributesBatchUpdated:roomID:

zim:roomAttributesBatchUpdated:roomID:
- (void)zim:(ZIM) zim roomAttributesBatchUpdated:(NSArray<ZIMRoomAttributesUpdateInfo *> *) infos roomID:(NSString *) roomID;
Event callback when the room attributes batch changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infosNSArray<ZIMRoomAttributesUpdateInfo *> *Room attribute change information list
roomIDNSString *The ID of the room where this event occurred.

Details

When room attributes in the room change in batch, this callback notifies the users.

  • Triggered when:This callback is triggered when another user in the room calls the batch attribute change interface for room attributes.
  • Use cases:In voice chat room scenarios, room attributes can be used to manage microphone seat information.
  • Related APIs:[beginRoomAttributesBatchOperation], [endRoomAttributesBatchOperation].
  • Available since:1.3.0 and above.

zim:roomMemberAttributesUpdated:operatedInfo:roomID:

zim:roomMemberAttributesUpdated:operatedInfo:roomID:
- (void)zim:(ZIM) zim roomMemberAttributesUpdated:(NSArray<ZIMRoomMemberAttributesUpdateInfo *> *) infos operatedInfo:(ZIMRoomOperatedInfo) operatedInfo roomID:(NSString *) roomID;
Event callback when the room member attributes changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infosNSArray<ZIMRoomMemberAttributesUpdateInfo *> *Room member attribute change information list
operatedInfoZIMRoomOperatedInfoOperation information
roomIDNSString *The ID of the room where this event occurred.

Details

When the member user attributes in the room change, this callback notifies the users.

  • Triggered when:This callback is triggered when another user's attributes are changed in the room and the current user is online.
  • Use cases:When business additional information needs to be recorded for each member in the room, this callback can be used to receive changes and refresh the UI.
  • Related APIs:[setRoomMemberAttributes].
  • Available since:1.3.0 and above.

zim:groupStateChanged:event:operatedInfo:groupInfo:

zim:groupStateChanged:event:operatedInfo:groupInfo:
- (void)zim:(ZIM) zim groupStateChanged:(ZIMGroupState) state event:(ZIMGroupEvent) event operatedInfo:(ZIMGroupOperatedInfo) operatedInfo groupInfo:(ZIMGroupFullInfo) groupInfo;
Event callback when the group state changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
stateZIMGroupStateGroup status.
eventZIMGroupEventGroup related events.
operatedInfoZIMGroupOperatedInfoGroup operation information.
groupInfoZIMGroupFullInfoGroup detailed information.

Details

Callback notification of group status change. Used to describe the current lifecycle state of the group and the events triggered when the lifecycle state changes.

  • Use cases:Scenarios that require interaction based on the group status.
  • Triggered when:A notification is triggered when a group is created, joined, left, or dismissed.
  • Related APIs:[createGroup] creates a group; [joinGroup] joins a group; [leaveGroup] leaves a group; [dismissGroup] dismisses a group.
  • Available since:2.0.0 and above.

zim:groupNameUpdated:operatedInfo:groupID:

zim:groupNameUpdated:operatedInfo:groupID:
- (void)zim:(ZIM) zim groupNameUpdated:(NSString *) groupName operatedInfo:(ZIMGroupOperatedInfo) operatedInfo groupID:(NSString *) groupID;
Event callback when the group name changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
groupNameNSString *Group name.
operatedInfoZIMGroupOperatedInfoGroup operation information.
groupIDNSString *Group ID.

Details

Group name change notification callback.

  • Use cases:When the group name changes, you need to synchronize the latest group name.
  • Triggered when:Triggered when the group name changes.
  • Related APIs:[updateGroupName], which updates the group name.
  • Available since:2.0.0 and above.

zim:groupAvatarUrlUpdated:operatedInfo:groupID:

zim:groupAvatarUrlUpdated:operatedInfo:groupID:
- (void)zim:(ZIM) zim groupAvatarUrlUpdated:(NSString *) groupAvatarUrl operatedInfo:(ZIMGroupOperatedInfo) operatedInfo groupID:(NSString *) groupID;
Event callback when the group avatar changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
groupAvatarUrlNSString *Group avatar.
operatedInfoZIMGroupOperatedInfoGroup operation information.
groupIDNSString *Group ID.

Details

Notification callback when the group avatar URL changes.

  • Use cases:When the group avatar URL changes, you need to synchronize the latest group avatar URL.
  • Triggered when:The group avatar URL changes.
  • Related APIs:[updateGroupAvatarUrl], which updates the group avatar URL.
  • Available since:2.0.0 and above.

zim:groupNoticeUpdated:operatedInfo:groupID:

zim:groupNoticeUpdated:operatedInfo:groupID:
- (void)zim:(ZIM) zim groupNoticeUpdated:(NSString *) groupNotice operatedInfo:(ZIMGroupOperatedInfo) operatedInfo groupID:(NSString *) groupID;
Event callback when the group notice changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
groupNoticeNSString *Group notice.
operatedInfoZIMGroupOperatedInfoGroup operation information.
groupIDNSString *Group ID.

Details

Group notice change notification callback.

  • Use cases:When the group notice changes, you need to synchronize the latest notice content.
  • Triggered when:Triggered when the group notice changes.
  • Related APIs:[updateGroupNotice], which updates the group notice.
  • Available since:2.0.0 and above.

zim:groupAliasUpdated:operatedUserID:groupID:

zim:groupAliasUpdated:operatedUserID:groupID:
- (void)zim:(ZIM) zim groupAliasUpdated:(NSString *) groupAlias operatedUserID:(NSString *) operatedUserID groupID:(NSString *) groupID;
Event callback when the group alias changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
groupAliasNSString *Group alias.
operatedUserIDNSString *Operated user ID.
groupIDNSString *Group ID.

Details

Group alias change notification callback.

  • Use cases:When the group alias changes, you need to synchronize the latest alias content.
  • Triggered when:Triggered when the current user who set the group alias or their online multi-device devices change the group alias.
  • Caution:The group alias feature is only visible to the user who set it. Therefore, changes to the group alias by the current user will not be pushed to other users in the group.
  • Related APIs:[updateGroupAlias], which updates the group alias.
  • Available since:2.0.0 and above.

zim:groupAttributesUpdated:operatedInfo:groupID:

zim:groupAttributesUpdated:operatedInfo:groupID:
- (void)zim:(ZIM) zim groupAttributesUpdated:(NSArray<ZIMGroupAttributesUpdateInfo *> *) infoList operatedInfo:(ZIMGroupOperatedInfo) operatedInfo groupID:(NSString *) groupID;
Event callback when the group attributes change.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infoListNSArray<ZIMGroupAttributesUpdateInfo *> *Group attribute change information.
operatedInfoZIMGroupOperatedInfoGroup operation information.
groupIDNSString *Group ID.

Details

Group attribute change notification callback.

  • Use cases:When group attributes are changed, you need to synchronize the latest group attributes.
  • Triggered when:Triggered when group attributes are set, updated, or deleted.
  • Related APIs:[setGroupAttributes] updates group attributes; [deleteGroupAttributes] deletes group attributes.
  • Available since:2.0.0 and above.

zim:groupMutedInfoUpdated:operatedInfo:groupID:

zim:groupMutedInfoUpdated:operatedInfo:groupID:
- (void)zim:(ZIM) zim groupMutedInfoUpdated:(ZIMGroupMuteInfo) mutedInfo operatedInfo:(ZIMGroupOperatedInfo) operatedInfo groupID:(NSString *) groupID;
Event callback when the group is muted.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
mutedInfoZIMGroupMuteInfoGroup mute information.
operatedInfoZIMGroupOperatedInfoGroup operation information.
groupIDNSString *Group ID.

Details

Notification callback when the group mute information changes.

  • Triggered when:When the group mute information changes, users in the group will trigger this callback.
  • Related APIs:[muteGroup], group mute.
  • Available since:2.14.0 and above.

zim:groupVerifyInfoUpdated:operatedInfo:groupID:

zim:groupVerifyInfoUpdated:operatedInfo:groupID:
- (void)zim:(ZIM) zim groupVerifyInfoUpdated:(ZIMGroupVerifyInfo) verifyInfo operatedInfo:(ZIMGroupOperatedInfo) operatedInfo groupID:(NSString *) groupID;
Event callback when the group verification information changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
verifyInfoZIMGroupVerifyInfoGroup verification information.
operatedInfoZIMGroupOperatedInfoGroup operation information.
groupIDNSString *Group ID.

Details

Notification callback when the group join verification mode changes.

  • Triggered when:When the group owner or administrator changes the group join verification mode, users in the group will trigger this callback.
  • Related APIs:[updateGroupJoinMode, updateGroupInviteMode, updateGroupBeInviteMode].

zim:groupMemberStateChanged:event:userList:operatedInfo:groupID:

zim:groupMemberStateChanged:event:userList:operatedInfo:groupID:
- (void)zim:(ZIM) zim groupMemberStateChanged:(ZIMGroupMemberState) state event:(ZIMGroupMemberEvent) event userList:(NSArray<ZIMGroupMemberInfo *> *) userList operatedInfo:(ZIMGroupOperatedInfo) operatedInfo groupID:(NSString *) groupID;
Event callback when the group member status changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
stateZIMGroupMemberStateGroup member status.
eventZIMGroupMemberEventGroup member event.
userListNSArray<ZIMGroupMemberInfo *> *Group member information list.
operatedInfoZIMGroupOperatedInfoGroup operation information.
groupIDNSString *Group ID.

Details

Callback notification when group member status changes.

  • Use cases:Scenarios that require interaction based on group member states, such as displaying group member join/leave notification UI.
  • Triggered when: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] leaves a group, [dismissGroup] dismisses a group, [inviteUsersIntoGroup] invites users into the group, [kickGroupMembers] kicks out members.
  • Available since:2.0.0 and above.

zim:groupMemberInfoUpdated:operatedInfo:groupID:

zim:groupMemberInfoUpdated:operatedInfo:groupID:
- (void)zim:(ZIM) zim groupMemberInfoUpdated:(NSArray<ZIMGroupMemberInfo *> *) userList operatedInfo:(ZIMGroupOperatedInfo) operatedInfo groupID:(NSString *) groupID;
Event callback when the group member information changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
userListNSArray<ZIMGroupMemberInfo *> *Group member information list.
operatedInfoZIMGroupOperatedInfoGroup operation information.
groupIDNSString *Group ID.

Details

Callback for group member basic information change events, including group member nickname, role, and other change events.

  • Use cases:After the basic information of group members is changed, scenarios that require displaying or interacting with group members on the page, such as displaying notifications when a group member's role changes.
  • Triggered when:After group member information changes, users in the group will trigger this notification.
  • Related APIs:[setGroupMemberNickname] updates group member nickname; [setGroupMemberRole] updates group member role; [transferGroupOwner] transfers group ownership.

zim:groupApplicationListChanged:action:

zim:groupApplicationListChanged:action:
- (void)zim:(ZIM) zim groupApplicationListChanged:(NSArray<ZIMGroupApplicationInfo *> *) applicationList action:(ZIMGroupApplicationListChangeAction) action;
Event callback when the group application list changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
applicationListNSArray<ZIMGroupApplicationInfo *> *Group application list.
actionZIMGroupApplicationListChangeActionGroup operation information.

Details

This callback is triggered when the group join application list changes.

  • Related APIs:[sendGroupJoinApplication], [sendGroupInviteApplications].
  • Available since:2.15.0 and above.

zim:groupApplicationUpdated:

zim:groupApplicationUpdated:
- (void)zim:(ZIM) zim groupApplicationUpdated:(NSArray<ZIMGroupApplicationInfo *> *) applicationList;
Event callback when the group application information changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
applicationListNSArray<ZIMGroupApplicationInfo *> *Group application list.

Details

This callback is triggered when the group join application list information changes.

  • Related APIs:[acceptGroupJoinApplication], [rejectGroupJoinApplication], [acceptGroupInviteApplication], [rejectGroupInviteApplication].
  • Available since:2.15.0 and above.

zim:callInvitationCreated:callID:

zim:callInvitationCreated:callID:
- (void)zim:(ZIM) zim callInvitationCreated:(ZIMCallInvitationCreatedInfo) info callID:(NSString *) callID;
Event callback when the call invitation is created.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infoZIMCallInvitationCreatedInfoCall invitation information.
callIDNSString *Call ID.

Details

After the inviter initiates a call invitation and the inviter is online, this callback will be received.

  • Triggered when:If the inviter has multiple online devices, all multi-device devices of the current user will trigger this callback after the inviter sends the call invitation.
  • Related APIs:[callInvite].
  • Available since:2.13.0 and above.

zim:callInvitationReceived:callID:

zim:callInvitationReceived:callID:
- (void)zim:(ZIM) zim callInvitationReceived:(ZIMCallInvitationReceivedInfo) info callID:(NSString *) callID;
Event callback when the call invitation is received.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infoZIMCallInvitationReceivedInfoCall invitation information.
callIDNSString *Call ID.
  • Use cases:The invitee will call this callback after the inviter sends a call invitation.
  • Triggered when:After creating a ZIM instance through [create].
  • Caution:If the user is not in the invitation list or not online, this callback will not be called.
  • Related APIs:[callInvite].
  • Available since:2.0.0 and above.

zim:callInvitationCancelled:callID:

zim:callInvitationCancelled:callID:
- (void)zim:(ZIM) zim callInvitationCancelled:(ZIMCallInvitationCancelledInfo) info callID:(NSString *) callID;
Event callback when the call invitation is cancelled.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infoZIMCallInvitationCancelledInfoCall invitation cancellation information.
callIDNSString *Call ID.
  • Use cases:The invitee will call this callback after the inviter cancels the call invitation.
  • Triggered when:After creating a ZIM instance through [create].
  • Caution:If the user is not in the cancel invitation list or is offline, this callback will not be called.
  • Related APIs:[callCancel].
  • Available since:2.0.0 and above.

zim:callInvitationEnded:callID:

zim:callInvitationEnded:callID:
- (void)zim:(ZIM) zim callInvitationEnded:(ZIMCallInvitationEndedInfo) info callID:(NSString *) callID;
Event callback when the call invitation is ended.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infoZIMCallInvitationEndedInfoCall invitation end information.
callIDNSString *Call ID.

Details

After an advanced mode call invitation is established and a participant ends the call, all participants will receive this callback.

  • Caution:If the user is not a participant who initiated this call or is not online, this callback will not be received.
  • Related APIs:[callEnd].
  • Available since:2.9.0 and above.

zim:callInvitationTimeout:callID:

zim:callInvitationTimeout:callID:
- (void)zim:(ZIM) zim callInvitationTimeout:(ZIMCallInvitationTimeoutInfo) info callID:(NSString *) callID;
Event callback when the call invitation times out.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infoZIMCallInvitationTimeoutInfoCall invitation timeout information.
callIDNSString *Call ID.

Details

When the call invitation times out, the invitee does not respond and will receive a callback.

  • Use cases:If the invitee does not respond before the timeout period, this callback will be received.
  • Triggered when:After creating a ZIM instance through [create].
  • Caution:If the user is not on the invitation list or is not online, the callback will not be received.
  • Related APIs:[callInvite], [callAccept], [callReject].
  • Available since:2.9.0 and above.

zim:callUserStateChanged:callID:

zim:callUserStateChanged:callID:
- (void)zim:(ZIM) zim callUserStateChanged:(ZIMCallUserStateChangeInfo) info callID:(NSString *) callID;
Event callback when the call invitation user status changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
infoZIMCallUserStateChangeInfoCall invitation user status change information.
callIDNSString *Call ID.

Details

Listen for calling user status changes.

  • Triggered when: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.
  • Caution: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].
  • Available since:2.9.0 and above.

zim:friendListChanged:action:

zim:friendListChanged:action:
- (void)zim:(ZIM) zim friendListChanged:(NSArray<ZIMFriendInfo *> *) friendInfoList action:(ZIMFriendListChangeAction) action;
Event callback when the friend list changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
friendInfoListNSArray<ZIMFriendInfo *> *Friend information list.
actionZIMFriendListChangeActionFriend list change operation.

Details

When the friend list changes, this callback is triggered for the current user and all devices logged in by the current user.

  • Triggered when:This callback is triggered when the current user's friend list changes, i.e., when a friend is added, deleted, or similar events occur.
  • Related APIs:[addFriend], [deleteFriends].
  • Available since:2.14.0 and above.

zim:friendInfoUpdated:

zim:friendInfoUpdated:
- (void)zim:(ZIM) zim friendInfoUpdated:(NSArray<ZIMFriendInfo *> *) friendInfoList;
Event callback when the friend information changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
friendInfoListNSArray<ZIMFriendInfo *> *List of updated friend information.

Details

This callback is triggered when friend information is updated.

  • Triggered when:This callback is triggered when a friend's basic information changes, such as avatar or name, or when the current user or another online device modifies a friend's alias or attributes.
  • Related APIs:[updateFriendAlias], [updateFriendAttributes].
  • Available since:2.14.0 and above.

zim:friendApplicationListChanged:action:

zim:friendApplicationListChanged:action:
- (void)zim:(ZIM) zim friendApplicationListChanged:(NSArray<ZIMFriendApplicationInfo *> *) friendApplicationInfoList action:(ZIMFriendApplicationListChangeAction) action;
Event callback when the friend application list changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
friendApplicationInfoListNSArray<ZIMFriendApplicationInfo *> *Friend application information list.
actionZIMFriendApplicationListChangeActionFriend application list change operation.

Details

This callback is triggered when the friend application list changes.

  • Triggered when:This callback is triggered when a user applies to become a friend, or when you send a friend application to a user, causing changes to the friend application list.
  • Related APIs:[sendFriendApplication].
  • Available since:2.14.0 and above.

zim:friendApplicationUpdated:

zim:friendApplicationUpdated:
- (void)zim:(ZIM) zim friendApplicationUpdated:(NSArray<ZIMFriendApplicationInfo *> *) friendApplicationInfoList;
Event callback when the friend application information changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
friendApplicationInfoListNSArray<ZIMFriendApplicationInfo *> *Friend application information list.

Details

This callback is triggered when the status or information of the friend application list is updated.

  • Triggered when:This callback is triggered when the other party accepts or rejects your friend application, or when you accept or reject the other party's friend application, causing changes to the friend application information.
  • Related APIs:[acceptFriendApplication], [rejectFriendApplication].
  • Available since:2.14.0 and above.

zim:blacklistChanged:action:

zim:blacklistChanged:action:
- (void)zim:(ZIM) zim blacklistChanged:(NSArray<ZIMUserInfo *> *) userList action:(ZIMBlacklistChangeAction) action;
Event callback when the blacklist changes.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
userListNSArray<ZIMUserInfo *> *Blacklist user list.
actionZIMBlacklistChangeActionBlacklist change operation.

Details

This callback is triggered when the current user's blacklist changes.

  • Triggered when:This callback is triggered for the current user and all online devices when the current user adds or removes a user from the blacklist.
  • Related APIs:[addUsersToBlacklist], [removeUsersFromBlacklist].
  • Available since:2.13.0 and above.

zim:communityListChangedWithResult:

zim:communityListChangedWithResult:
- (void)zim:(ZIM) zim communityListChangedWithResult:(ZIMCommunityListChangedEventResult) result;
Received notification callback for community list changed.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
resultZIMCommunityListChangedEventResultThe community list changed event callback result

Details

This callback is received when the current user's own community list changes, or when attributes such as the total unread count of joined communities change.

  • Triggered when:This callback is triggered when the current user joins a new community, leaves a joined community, or when the total unread count of a joined community changes.
  • Use cases:Used to display the list of communities the current user has joined in the UI and subsequent changes.
  • Caution:Only communities that you have joined will trigger this callback notification. Communities you have not joined will not trigger this callback.
  • Related APIs:[createCommunity], [joinCommunity], [leaveCommunity], [dismissCommunity].
  • Available since:3.0.0 and above.

zim:communityInfoUpdatedWithResult:

zim:communityInfoUpdatedWithResult:
- (void)zim:(ZIM) zim communityInfoUpdatedWithResult:(ZIMCommunityInfoUpdatedEventResult) result;
Received notification callback for community info updated.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
resultZIMCommunityInfoUpdatedEventResultThe community info list updated event callback result

Details

This callback is received when the current community information changes.

  • Triggered when:When the current community information changes, such as when the community name, avatar, notice, or other attributes are modified by the community owner or administrator, community members will trigger this callback.
  • Use cases:Used to display the latest community attribute data in the UI.
  • Caution:Due to the large scale of community membership, when community attributes change, push notifications are only sent to users who have recently called [queryCommunityInfo]. Users who do not receive the push notification can also obtain the latest community attributes via [queryCommunityInfo].
  • Related APIs:[updateCommunityName], [updateCommunityAvatarUrl], [updateCommunityNotice], [setCommunityAttributes], [deleteCommunityAttributes].
  • Available since:3.0.0 and above.

zim:communityMemberStateChangedWithResult:

zim:communityMemberStateChangedWithResult:
- (void)zim:(ZIM) zim communityMemberStateChangedWithResult:(ZIMCommunityMemberStateChangedEventResult) result;
.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
resultZIMCommunityMemberStateChangedEventResultThe community member state change event callback result

Details

This callback is received when the status of members in the community changes.

  • Triggered when:This callback is triggered when events that change the community member status occur, such as a community member joining or leaving.
  • Caution:Due to the large scale of community membership, when a community member's status changes, push notifications are only sent to users who have recently called [queryCommunityInfo]. Users who do not receive the push notification can also obtain the latest community member list via [queryCommunityMemberList].
  • Related APIs:[joinCommunity], [leaveCommunity], [inviteUsersIntoCommunity], [kickCommunityMembers].
  • Available since:3.0.0 and above.

zim:communityMemberInfoUpdatedWithResult:

zim:communityMemberInfoUpdatedWithResult:
- (void)zim:(ZIM) zim communityMemberInfoUpdatedWithResult:(ZIMCommunityMemberInfoUpdatedEventResult) result;
.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
resultZIMCommunityMemberInfoUpdatedEventResultThe community member state change event callback result

Details

This callback is received when member information in the community changes.

  • Triggered when:This callback is triggered when a community member's role changes, when a community member is muted or unmuted, or when their basic user information changes.
  • Caution:Due to the large scale of community membership, when a community member's status changes, push notifications are only sent to users who have recently called [queryCommunityInfo]. Users who do not receive the push notification can also obtain the latest community member information via [queryCommunityMembers].
  • Related APIs:[updateCommunityMemberRole], [muteCommunityMembers].
  • Available since:3.0.0 and above.

zim:communityChannelListChangedWithResult:

zim:communityChannelListChangedWithResult:
- (void)zim:(ZIM) zim communityChannelListChangedWithResult:(ZIMCommunityChannelListChangedEventResult) result;
Received notification callback for community channel list changed.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
resultZIMCommunityChannelListChangedEventResultThe community channel list changed event callback result

Details

This callback is received when the community channel list changes or when attributes within a channel change.

  • Triggered when:This callback is triggered when a channel in the community is created or deleted, or when messages are produced in a channel (similar to conversation-related operations).
  • Use cases:Used by developers to render the user chat activity in community channels in real time.
  • Related APIs:[sendMessage], [createCommunityChannel], [dismissCommunityChannel], [clearConversationUnreadMessageCount], etc.
  • Available since:3.0.0 and above.

zim:communityChannelInfoUpdatedWithResult:

zim:communityChannelInfoUpdatedWithResult:
- (void)zim:(ZIM) zim communityChannelInfoUpdatedWithResult:(ZIMCommunityChannelInfoUpdatedEventResult) result;
Received notification callback for community info updated.
Declared in ZIMEventHandler.h

Parameters

NameTypeDescription
zimZIMZIM instance.
resultZIMCommunityChannelInfoUpdatedEventResultThe community channel info list updated event callback result

Details

This callback is received when the attributes of a channel in the community change.

  • Triggered when:When the community channel name, channel notice, channel attributes, channel mute, or other attributes are changed by the community owner or administrator, active users in the channel will trigger this callback.
  • Caution:Due to the large scale of community membership, ZIM filters active users based on each user's API call behavior to push channel information change notifications. Users who do not receive the push notification can also obtain the latest community channel information via [queryCommunityChannelsInfo].
  • Related APIs:[updateCommunityChannelName], [updateCommunityChannelAvatarUrl], [updateCommunityChannelNotice], [setCommunityChannelAttributes], [deleteCommunityChannelAttributes].
  • Available since:3.0.0 and above.

Previous

Class

Next

Enum

On this page

Back to top