Documentation
zim_API In-app Chat
Documentation
Demo APP
SDK Center
API Center
FAQ
Code Market
Console
Sign Up
Log In
中文站 English
  • Documentation
  • In-app Chat
  • Function Overview
  • Function Overview

Function Overview

Last updated:2025-03-22 00:13

ZEGO ZIM SDKs provide rich APIs for you to quickly build in app chat capabilities into your applications.

ZEGO ZIM SDKs are available for all major platforms, including Android, iOS, Mac, Windows, and Web.

SDK Initialization Related Functions

Method Description
querySubscribedUserStatusListWithConfig:callback: This command is used to query the user status subscription list of the current user.
queryUsersStatusByUserIDs:callback: Query the user statuses of other users.
subscribeUsersStatus:config:callback: Subscribe to the user status of other users
unsubscribeUsersStatus:callback: This command is used to batch unsubscribe the target users in the current user subscription list.
updateUserOfflinePushRule:offlinePushRule:callback: Modify the custom rule of offline push
querySelfUserInfo:callback: Query user information and user rules.
createWithAppID: Create a ZIM instance.
createWithAppConfig: Create a ZIM instance.
getVersion Gets the SDK's version number.
getInstance Get the ZIM singleton object.
setEventHandler: 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.
setLogConfig: Set log related configuration.
setGeofencingConfig: Set geofence-related configurations.
setCacheConfig: Set cache related configuration.
loginWithUserInfo:token:callback: Login, you must log in before using all functions.
loginWithUserInfo:callback: Login, you must log in before using all functions.
loginWithUserID:config:callback;: Login, you must log in before using all functions.
renewToken:callback: Update the authentication token.
queryUsersInfo:userIDs:config:callback: Query user information.
updateUserName:userName:callback: Update user's user name.
updateUserAvatarUrl:userAvatarUrl:callback: Update user's avatar URL.
updateUserExtendedData:extendedData:callback: Update user's user extended data.
uploadLog: Upload log and call after setting up log path.
logout Log out of ZIM service.
destroy Destroy the ZIM instance.
zim:errorInfo: The callback for error information.
zim:tokenWillExpire: A reminder callback that the token is about to expire.
zim:userInfoUpdated: Callback for user information update.
zim:userRuleUpdated: Callback of user rule changes.

Room functions

Method Description
createRoom: Create and join a room.
queryRoomMembersByUserIDs:userIDs:roomID:callback: Query the information of up to ten users in the specified room.
setRoomMembersAttributes:attributes:userIDs:roomID:config:callback: Set room member attributes (use this for all additions and changes).
queryRoomMembersAttributesByUserIDs:userIDs:roomID:callback: Batch query the room user attributes of the members in the room.
queryRoomMemberAttributesListByRoomID:roomID:config:callback: paginate the room user properties that have room property members in the room.
createRoom:config:callback: Create a room with advanced settings
enterRoom:config:callback: Enter the room. If the room does not exist, it will be created automatically.
switchRoomFromRoomID:fromRoomID:toRoomInfo:isCreateWhenRoomNotExisted:config: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.
joinRoom:roomID:callback: Join a room.
leaveRoom:roomID:callback: Leave a room.
leaveAllRoom:callback: Leave all rooms entered.
queryRoomMemberListByRoomID:roomID:config:callback: Query the list of members in the room.
queryRoomOnlineMemberCountByRoomID:callback: Query the number of online members in the room.
queryRoomAllAttributesByRoomID:roomID:callback: Query all properties of the room.
setRoomAttributes:roomAttributes:roomID:config:callback: Set room attributes (use this for all additions and changes).
deleteRoomAttributesByKeys:roomID:config:callback: Delete room attributes.
beginRoomAttributesBatchOperationWithRoomID:config: Open combination room attribute operation.
endRoomAttributesBatchOperationWithRoomID:callback: Complete the property operation of the combined room.
zim:receiveRoomMessage:fromRoomID: The callback for receiving room message.
zim:roomStateChanged:event:extendedData: event callback when the room connection status changes.
zim:roomMemberJoined:roomID: Callback when other members join the room.
zim:roomMemberLeft:roomID: Callback when other members leave the room.

Message functions

Method Description
editMessage:message:config:notification:callback: Edit message.
sendMessage:message:toConversationID:conversationType:config:notification:callback: send message.
sendMediaMessage:message:toConversationID:conversationType:config:notification:callback: Send media messages.
insertMessageToLocalDB:message:conversationID:conversationType:senderUserID:callback: Insert a message to the local DB.
clearLocalFileCacheWithConfig:config:callback: Clear the local message cache of the current user.
queryLocalFileCacheWithConfig:config:callback: Query the local message cache of the current user.
exportLocalMessagesToFolderPath:folderPath:config:progress:callback: Example Export the local message of the current user.
importLocalMessagesToFolderPath:folderPath:config:progress:callback: Example Import the local message of the current user.
sendConversationMessageReceiptRead:conversationID:conversationType:callback: Sets all received receipts for the conversation as read.
sendMessageReceiptsRead:messageList:conversationID:conversationType:callback: Set the receipt of a batch of messages to become read.
queryMessageReceiptsInfoByMessageList:messageList:conversationID:conversationType:callback: Query the receipt information of a batch of messages.
queryGroupMessageReceiptReadMemberListByMessage:message:groupID:config:callback: Query the list of read members of the group
queryGroupMessageReceiptUnreadMemberListByMessage:message:groupID:config:callback: Query the list of read members of the group.
searchLocalMessagesByConversationID:conversationID:conversationType:config:callback: Search local message list.
searchLocalConversationsWithConfig:config:callback: Search local conversations on local messages.
searchGlobalLocalMessagesWithConfig:config:callback: Search global local message list.
replyMessage:message:toOriginalMessage:config:notification:callback: send reply message.
queryMessageRepliedListByMessage:message:config:callback: Query the reply list.
sendMediaMessage:message:toConversationID:conversationType:config:progress:callback: Send media messages.
downloadMediaFileWithMessage:message:fileType:config:progress:callback: Download media file message content.
downloadMediaFileWithMessage:message:fileType:progress:callback: Download media message content.
sendPeerMessage:message:toUserID:config:callback: Send peer-to-peer messages.
sendRoomMessage:message:toRoomID:config:callback: Send room messages.
sendGroupMessage:message:toGroupID:config:callback: Send group messages.
queryHistoryMessageByConversationID:conversationType:config:callback: Query historical messages.
queryMessagesByMessageSeqs:messageSeqs:conversationID:conversationType:callback: Query messages based on the message seq list.
deleteAllConversationMessagesWithConfig:config:callback: Delete all messages for all sessions.
queryCombineMessageDetailByMessage:message:callback: query combine message detail
revokeMessage:message:config:callback: revoke message.
deleteMessages:messageList:conversationID:conversationType:config:callback: delete message.
addMessageReaction:reactionType:message:callback: add message reaction
deleteMessageReaction:reactionType:message:callback: delete message reaction
queryMessageReactionUserListByMessage:message:config:callback: query message reaction userlist
deleteAllMessageByConversationID:conversationID:conversationType:config:callback: Delete all message.
updateMessageLocalExtendedData:localExtendedData:message:callback: Update the local expandable field of the message.
zim:groupMessageReceived:info:fromGroupID: The callback for receiving group message.
zim:peerMessageReceived:info:fromUserID: The callback for receiving peer-to-peer message.
zim:roomMessageReceived:info:fromRoomID: The callback for receiving room message.
zim:messageEdited: The callback for receiving edited message.
zim:messageRevokeReceived: The callback for receiving revoke message.
zim:messageSentStatusChanged: The callback for received message send status change.
zim:broadcastMessageReceived: The callback of the broadcast message received by all employees.
zim:messageReactionsChanged: The callback of the reactions change.
zim:messageDeleted: Callback when the message is deleted.
zim:receivePeerMessage:fromRoomID: The callback for receiving peer-to-peer message.
zim:messageRepliedCountChanged: Reply to the event that the number of message trees has changed.
zim:messageRepliedInfoChanged: The reply information of a reply message is changed.
zim:receiveGroupMessage:fromGroupID: The callback for receiving group message.

Group functions

Method Description
createGroup:userIDs:callback: Create groups.
searchLocalGroupsWithConfig:config:callback: Search local groups.
searchLocalGroupMembersByGroupID:groupID:config:callback: Search local group members.
createGroup:userIDs:config:callback: Create a group with the andvanced info such as group attributes and group notice.
joinGroup:callback: join a goup.
leaveGroup:callback: Leave the group.
dismissGroup:callback: Disband the group.
kickGroupMembers:groupID:callback: kick some members out of the group.
inviteUsersIntoGroup:userIDs:groupID:callback: invite some members into the group.
transferGroupOwnerToUserID:groupID:callback: Transfer the group owner.
updateGroupAlias:groupAlias:groupID:callback: Update the group alias.
updateGroupName:groupID:callback: Update the group name.
muteGroup:isMute:groupID:config:callback: Mute a group
muteGroupMembers:isMute:userIDs:groupID:config:callback: Mute group members.
updateGroupAvatarUrl:groupID:callback: Update the group avatar URL.
updateGroupNotice:groupID:callback: Update group announcements.
updateGroupJoinMode:groupID:callback: Update group verification mode.
updateGroupInviteMode:groupID:callback: Update group verification mode.
acceptGroupInviteApplicationFromInviterUserID:groupID:config:callback: Accept an application to invite to the group.
acceptGroupJoinApplicationFromUserID:groupID:config:callback: Accept an application to join the group.
queryGroupApplicationListWithConfig:callback: Query the group application list.
rejectGroupInviteApplicationFromInviterUserID:groupID:config:callback: Reject an application to invite to the group.
rejectGroupJoinApplicationFromUserID:groupID:config:callback: Reject an application to join the group.
sendGroupInviteApplicationsToUserIDs:groupID:config:callback: Send an application to invite the group.
sendGroupJoinApplicationToGroupID:config:callback: Send an application to join the group.
updateGroupBeInviteMode:groupID:callback: Update group verification mode.
queryGroupInfoByGroupID:callback: Query group information.
queryGroupList: Query group list.
setGroupAttributes:groupID:callback: Add or update group attributes.
deleteGroupAttributesByKeys:groupID:callback: Delete group attribute.
queryGroupAttributesByKeys:groupID:callback: Query group attributes by keys.
queryGroupAllAttributesByGroupID:callback: Query all attributes of the group.
setGroupMemberRole:forUserID:groupID:callback: Set the group member role.
setGroupMemberNickname:forUserID:groupID:callback: Set group member nickname.
queryGroupMemberInfoByUserID:groupID:callback: Query group member information.
queryGroupMemberListByGroupID:config:callback: Query the list of group members.
queryGroupMemberMutedListByGroupID:config:callback: Query the list of group muted members.
queryGroupMemberCountByGroupID:groupID:callback: Query the number of group members in a specified group.
zim:groupStateChanged:operatedInfo:groupID: Group state change notification callback.
zim:groupAliasUpdated:operatedUserID:groupID: Group alias update notification callback.
zim:groupNameUpdated:operatedInfo:groupID: Group name update notification callback.
zim:groupAvatarUrlUpdated:operatedInfo:groupID: Group avatar URL update notification callback.
zim:groupNoticeUpdated:operatedInfo:groupID: Notification callback for group announcement updates.
zim:groupMutedInfoUpdated:operatedInfo:groupID: Notification callback for group mute info updates.
zim:groupVerifyInfoUpdated:operatedInfo:groupID: Notification callback for group verification mode update.
zim:groupAttributesUpdated:operatedInfo:groupID: Group property update attributes callback.
zim:groupMemberStateChanged:event:userList:operatedInfo:groupID: Group member state change notification callback.
zim:groupMemberInfoUpdated:operatedInfo:groupID: Group member basic information change notification.
zim:groupApplicationListChanged: This method will be called back when the group application list changes.
zim:groupApplicationUpdated: This method will be called back when the group application list changes.

Conversation functions

Method Description
queryConversation:conversationID:conversationType:callback: Query a conversation by conversation ID and conversation type.
queryConversationListWithConfig:callback: Query the conversation list.
queryConversationListWithConfig:callback: Query the conversation list by filter options.
queryConversationPinnedListWithConfig:config:callback: Query the conversation pinned list.
queryConversationTotalUnreadMessageCountWithConfig:callback: Query the conversations total unread message count by config.
updateConversationPinnedState:isPinned:conversationID:conversationType:callback: Modify the conversation pinned state.
deleteAllConversationsWithConfig:config:callback: delete all conversations.
deleteConversation:conversationType:config:callback: delete the conversation.
setConversationDraft:draft:conversationID:conversationType:callback: Set a conversation draft.
clearConversationTotalUnreadMessageCount:callback: clear all conversations unreads.
clearConversationUnreadMessageCount:conversationType:config:callback: clear session unreads.
setConversationMark:markType:enable:conversationInfos:callback: Set or unset conversation marks.
setConversationNotificationStatus:conversationID:conversationType:callback: Set the conversation notification state.
zim:conversationChanged: Received notification callback for session update.
zim:conversationMessageReceiptChanged: Callback for notifications of read updates for sessions that receive receipts.
conversationsAllDeleted:zim:info: The callback of all conversation deletion was received.
zim:messageReceiptChanged: The notification callback for the read update of the message that received the receipt.
zim:conversationTotalUnreadMessageCountUpdated: Notification callback for session total unread updates.

Call Invitation functions

Method Description
callInviteWithInvitees:config:callback: Initiate a call invitation.
callJoin:callID:config:callback: Join an advanced mode call, or switch the main device for the advanced mode call (multi-terminal login only).
callCancelWithInvitees:config:callback: Cancel the call invitation.
callAcceptWithCallID:config:callback: Accept the call invitation.
callRejectWithCallID:config:callback: Reject the call invitation.
callQuit:config:callback: Reject the call invitation.
callEnd:config:callback: End the call invitation.
callingInviteWithInvitees:callID:config:callback: Invite other users to join the call invitation
queryCallInvitationListWithConfig:callback: Query call invitation list
zim:blacklistChanged:userList: This method will be called back when the blacklist is updated or changes occur.
zim:callInvitationReceived:callID: The notification callback for the call invitation received by the invitee.
zim:callInvitationCreated:callID: The notification callback for the call invitation created by the caller.
zim:callInvitationCancelled:callID: The notification callback received by the invitee to cancel the invitation.
zim:callInvitationTimeout: Callback for notification of called call invitation timeout.
zim:callInvitationAccepted:info:callID: The notification callback received by the inviter that invitee has accepted the invitation.
zim:callInvitationRejected:callID: The inviter receives the notification callback that the invitee reject the invitation.
zim:callInviteesAnsweredTimeout:callID: Callback for notification of caller call invitation timeout.
zim:callInvitationEnded:callID: Callback for notification of caller call invitation ended.
zim:callUserStateChanged:callID: Call the notification of the user status in the invitation invitation.

Offline Push functions

Method Description
addLocalNotificationWithContent:content:trigger:completionHandler: Add a local push notification.
ZPNsNotificationCenter:didReceiveNotificationResponse:withCompletionHandler: This callback method is triggered when the user clicks remote push to enter the APP.
onRegistered:Pushid: The callback triggered after generating PushID.
registerAPNs Register with APNs.
setBadge:badge: Reports the number of corners of the current App to the ZPNs server through this interface.
setDeviceToken:isProduct: Use this method to pass deviceToken into ZPNs and get PushID.
setPushConfig: Set push Settings for each vendor.
setVoIPToken:voIPtoken:isProduct: Used to upload the VoIP push token obtained from the system to ZPNs.
setZPNsNotificationCenterDelegate:delegate: 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.
shared Get the ZPNs instance.
ZPNsNotificationCenter:willPresentNotification:userInfo:withCompletionHandler: This callback method is triggered when the application receives a push in the foreground.
unregisterAPNs Call this method to de-register when offline push is not required.

Blacklist functions

Method Description
addUsersToBlacklistWithUserIDs:userIDs:callback: Add users to blacklist.
removeUsersFromBlacklistWithUserIDs:userIDs:callback: Remove the user from the blacklist.
queryBlacklistWithConfig:config:callback: Query the blacklist.
checkUserIsInBlackListByUserID:userID:callback: Check if the user is on the blacklist.

Friend functions

Method Description
addFriendByUserID:userID:config:callback: Add friends directly.
sendFriendApplicationToUserID:userID:config:callback: Send a friend application.
deleteFriendsByUserIDs:userIDs:config:callback: Delete friends.
checkFriendsRelationByUserIDs:userIDs:config:callback: Check friend relationships.
updateFriendAlias:friendAlias:userID:callback: Update friend alias.
updateFriendAttributes:friendAttributes:userID:callback: Update friend attributes.
acceptFriendApplicationFromUserID:userID:config:callback: Accept to friend request.
rejectFriendApplicationFromUserID:userID:config:callback: Accept to friend request.
queryFriendsInfoByUserIDs:userIDs:callback: Query friend information in batches.
queryFriendListWithConfig:config:callback: Query the friends list.
queryFriendApplicationListWithConfig:config:callback: Query the friend application list.
searchLocalFriendsWithConfig:config:callback: Search local friends.
zim:friendListChanged:friendInfoList: This method will be called back when the friend list is updated or changes occur.
zim:friendApplicationListChanged:friendApplicationInfoList: This method will be called back when the friend application list changes.
zim:friendApplicationUpdated:friendApplicationInfoList: The current method will be called when there is an update in the friend request list.
zim:friendInfoUpdated:friendInfoList: This callback will be triggered when there is an update in the friend information.

Audio functions

Method Description
getVersion Get the ZIM Audio SDK version number
setAdvancedConfigWithKey:key:value: Set Advanced Config.
sharedInstance Get an instance.
initWithLicense:license: Initialize ZIM Audio SDK
uninit Deinitialize the ZIM Audio SDK.
setEventHandler:eventHandler: Setting ZIM Audio SDK event notification.
enableANS:enable: Enable Acoustic Noise Suppression
enableAGC:enable: Enable Automatic Gain Control
setANSParam:param: Set ANS parameters
startRecordWithConfig:config: Start recording audio files.
completeRecord Finish recording the audio file.
cancelRecord Interrupt audio recording
isRecording Get whether ZIM Audio SDK is recording audio
setAudioRouteType:routeType: Set the audio routing type
startPlayWithConfig:config: Start audio playing
stopPlay Stops audio playing.
isPlaying Get whether ZIM Audio SDK is playing audio
onError:errorInfo: Error callback
onRecorderStarted Recording initiation callback
onRecorderCompleted:totalDuration: Recording completion callback
onRecorderCancelled Callback of recording cancellation
onRecorderProgress:currentDuration: Recording progress callback
onRecorderFailed:errorCode: Callback of voice recording failure
onPlayerStarted:totalDuration: Playback initiation callback
onPlayerEnded Playback conclusion callback
onPlayerStopped Playback termination callback
onPlayerProgress:currentDuration: Playback progress callback
onPlayerInterrupted Callback of voice-playing interruption
onPlayerFailed:errorCode: Player failure callback
Page Directory
  • Free trial
  • 提交工单
    咨询集成、功能及报价等问题
    电话咨询
    400 1006 604
    Get Consulting
    Scan Wechat QR code