This article provides some instructions and considerations for upgrading the ZIM SDK for Android version.
3.0.0 Upgrade Guide
Warning
This version (3.0.0) removes APIs that have been deprecated for over 1 year, along with related enum values and fields, and adds deprecation markers to some APIs. Please refer to the following instructions to complete the migration.
Removed deprecated APIs
ZIM initialization API (create)
The deprecated old create(appID, application) API has been removed. Please use the create API that accepts ZIMAppConfig instead.
The deprecated old login(ZIMUserInfo, token, callback) API has been removed. Please use the login API that accepts userID and ZIMLoginConfig instead.
New version usage
ZIMLoginConfig loginConfig = new ZIMLoginConfig();
loginConfig.userName = "userName";
loginConfig.token = ""; // Fill in the token if using token authentication
loginConfig.isOfflineLogin = false;
zim.login("userID", loginConfig, new ZIMLoggedInCallback() {
@Override
public void onLoggedIn(ZIMError error) {
// Login result
}
});
ZIMLoginConfig loginConfig = new ZIMLoginConfig();
loginConfig.userName = "userName";
loginConfig.token = ""; // Fill in the token if using token authentication
loginConfig.isOfflineLogin = false;
zim.login("userID", loginConfig, new ZIMLoggedInCallback() {
@Override
public void onLoggedIn(ZIMError error) {
// Login result
}
});
New version usage
ZIMLoginConfig loginConfig;
loginConfig.userName = "userName";
loginConfig.token = ""; // Fill in the token if using token authentication
loginConfig.isOfflineLogin = false;
zim->login("userID", loginConfig, [=](const ZIMError &errorInfo) {
// Login result
});
ZIMLoginConfig loginConfig;
loginConfig.userName = "userName";
loginConfig.token = ""; // Fill in the token if using token authentication
loginConfig.isOfflineLogin = false;
zim->login("userID", loginConfig, [=](const ZIMError &errorInfo) {
// Login result
});
ZIM message sending API (sendMessage)
The deprecated sendPeerMessage, sendRoomMessage, sendGroupMessage, and old sendMessage API (without ZIMMessageSendNotification parameter) have been removed. Please use the sendMessage API with the notification parameter instead.
New version usage
ZIMTextMessage textMessage = new ZIMTextMessage("Hello");
ZIMMessageSendConfig config = new ZIMMessageSendConfig();
ZIMMessageSendNotification notification = new ZIMMessageSendNotification();
notification.onMessageAttached = message -> {
// Business logic before message is sent
};
zim.sendMessage(textMessage, "toConversationID", ZIMConversationType.PEER,
config, notification, new ZIMMessageSentFullCallback() {
@Override
public void onMessageSent(ZIMMessage message, ZIMError errorInfo) {
// Message sent result
}
@Override
public void onMessageAttached(ZIMMessage message) {}
});
ZIMTextMessage textMessage = new ZIMTextMessage("Hello");
ZIMMessageSendConfig config = new ZIMMessageSendConfig();
ZIMMessageSendNotification notification = new ZIMMessageSendNotification();
notification.onMessageAttached = message -> {
// Business logic before message is sent
};
zim.sendMessage(textMessage, "toConversationID", ZIMConversationType.PEER,
config, notification, new ZIMMessageSentFullCallback() {
@Override
public void onMessageSent(ZIMMessage message, ZIMError errorInfo) {
// Message sent result
}
@Override
public void onMessageAttached(ZIMMessage message) {}
});
New version usage
auto textMessage = std::make_shared<ZIMTextMessage>();
textMessage->message = "Hello";
ZIMMessageSendConfig config;
auto notification = std::make_shared<ZIMMessageSendNotification>();
notification->onMessageAttached = [=](const std::shared_ptr<ZIMMessage> &message) {
// Business logic before message is sent
};
zim->sendMessage(textMessage, "toConversationID",
ZIMConversationType::ZIM_CONVERSATION_TYPE_PEER, config, notification,
[=](const std::shared_ptr<ZIMMessage> &message, const ZIMError &errorInfo) {
// Message sent result
});
auto textMessage = std::make_shared<ZIMTextMessage>();
textMessage->message = "Hello";
ZIMMessageSendConfig config;
auto notification = std::make_shared<ZIMMessageSendNotification>();
notification->onMessageAttached = [=](const std::shared_ptr<ZIMMessage> &message) {
// Business logic before message is sent
};
zim->sendMessage(textMessage, "toConversationID",
ZIMConversationType::ZIM_CONVERSATION_TYPE_PEER, config, notification,
[=](const std::shared_ptr<ZIMMessage> &message, const ZIMError &errorInfo) {
// Message sent result
});
ZIM media file download API (downloadMediaFile)
The deprecated old downloadMediaFile API (without config parameter) has been removed. Please use the new downloadMediaFile API with the ZIMMediaDownloadConfig parameter instead.
New version usage
ZIMImageMessage imageMessage = (ZIMImageMessage) message;
ZIMMediaDownloadConfig config = new ZIMMediaDownloadConfig();
zim.downloadMediaFile(imageMessage, ZIMMediaFileType.ORIGINAL_FILE, config,
new ZIMMediaDownloadedCallback() {
@Override
public void onMediaDownloadingProgress(ZIMMessage message,
long currentFileSize, long totalFileSize) {
// Download progress
}
@Override
public void onMediaDownloaded(ZIMMessage message, ZIMError errorInfo) {
// Download complete
}
});
ZIMImageMessage imageMessage = (ZIMImageMessage) message;
ZIMMediaDownloadConfig config = new ZIMMediaDownloadConfig();
zim.downloadMediaFile(imageMessage, ZIMMediaFileType.ORIGINAL_FILE, config,
new ZIMMediaDownloadedCallback() {
@Override
public void onMediaDownloadingProgress(ZIMMessage message,
long currentFileSize, long totalFileSize) {
// Download progress
}
@Override
public void onMediaDownloaded(ZIMMessage message, ZIMError errorInfo) {
// Download complete
}
});
New version usage
auto imageMessage = std::static_pointer_cast<ZIMImageMessage>(message);
ZIMMediaDownloadConfig config;
zim->downloadMediaFile(imageMessage,
ZIMMediaFileType::ZIM_MEDIA_FILE_TYPE_ORIGINAL_FILE, config,
[=](const std::shared_ptr<ZIMMessage> &msg,
unsigned long long currentFileSize, unsigned long long totalFileSize) {
// Download progress
},
[=](const std::shared_ptr<ZIMMessage> &msg, const ZIMError &errorInfo) {
// Download complete
});
auto imageMessage = std::static_pointer_cast<ZIMImageMessage>(message);
ZIMMediaDownloadConfig config;
zim->downloadMediaFile(imageMessage,
ZIMMediaFileType::ZIM_MEDIA_FILE_TYPE_ORIGINAL_FILE, config,
[=](const std::shared_ptr<ZIMMessage> &msg,
unsigned long long currentFileSize, unsigned long long totalFileSize) {
// Download progress
},
[=](const std::shared_ptr<ZIMMessage> &msg, const ZIMError &errorInfo) {
// Download complete
});
ZIM message receive callback APIs
The onReceivePeerMessage, onReceiveRoomMessage, and onReceiveGroupMessage callbacks deprecated in 2.18.0 have been officially removed in this version. It is recommended to migrate to onMessageReceived.
New version usage
@Override
public void onMessageReceived(ZIM zim, ZIMMessageReceivedEventResult result) {
List<ZIMMessage> messageList = result.messageList;
ZIMMessageReceivedInfo info = result.info;
String conversationID = result.conversationID;
ZIMConversationType conversationType = result.conversationType;
// Handle messages for different conversation types based on conversationType
}
@Override
public void onMessageReceived(ZIM zim, ZIMMessageReceivedEventResult result) {
List<ZIMMessage> messageList = result.messageList;
ZIMMessageReceivedInfo info = result.info;
String conversationID = result.conversationID;
ZIMConversationType conversationType = result.conversationType;
// Handle messages for different conversation types based on conversationType
}
New version usage
virtual void onMessageReceived(ZIM *zim,
const ZIMMessageReceivedEventResult &result) override {
auto &messageList = result.messageList;
auto &info = result.info;
auto &conversationID = result.conversationID;
auto conversationType = result.conversationType;
// Handle messages for different conversation types based on conversationType
}
virtual void onMessageReceived(ZIM *zim,
const ZIMMessageReceivedEventResult &result) override {
auto &messageList = result.messageList;
auto &info = result.info;
auto &conversationID = result.conversationID;
auto conversationType = result.conversationType;
// Handle messages for different conversation types based on conversationType
}
ZIM call invitation callback APIs
The old onCallInvitationTimeout(zim, callID), onCallInvitationRejected, onCallInvitationAccepted, and onCallInviteesAnsweredTimeout callbacks have been removed. Please use the new onCallInvitationTimeout and onCallUserStateChanged instead.
New version usage
@Override
public void onCallInvitationTimeout(ZIM zim,
ZIMCallInvitationTimeoutInfo info, String callID) {
// info.mode can distinguish between normal mode and advanced mode
}
@Override
public void onCallUserStateChanged(ZIM zim,
ZIMCallUserStateChangeInfo info, String callID) {
// info.callUserList contains the list of users whose status changed
// You can uniformly handle accept, reject, timeout, and other status changes
}
@Override
public void onCallInvitationTimeout(ZIM zim,
ZIMCallInvitationTimeoutInfo info, String callID) {
// info.mode can distinguish between normal mode and advanced mode
}
@Override
public void onCallUserStateChanged(ZIM zim,
ZIMCallUserStateChangeInfo info, String callID) {
// info.callUserList contains the list of users whose status changed
// You can uniformly handle accept, reject, timeout, and other status changes
}
New version usage
virtual void onCallInvitationTimeout(ZIM *zim,
const ZIMCallInvitationTimeoutInfo &info,
const std::string &callID) override {
// info.mode can distinguish between normal mode and advanced mode
}
virtual void onCallUserStateChanged(ZIM *zim,
const ZIMCallUserStateChangeInfo &info,
const std::string &callID) override {
// info.callUserList contains the list of users whose status changed
// You can uniformly handle accept, reject, timeout, and other status changes
}
virtual void onCallInvitationTimeout(ZIM *zim,
const ZIMCallInvitationTimeoutInfo &info,
const std::string &callID) override {
// info.mode can distinguish between normal mode and advanced mode
}
virtual void onCallUserStateChanged(ZIM *zim,
const ZIMCallUserStateChangeInfo &info,
const std::string &callID) override {
// info.callUserList contains the list of users whose status changed
// You can uniformly handle accept, reject, timeout, and other status changes
}
The importLocalMessages and exportLocalMessages APIs have been temporarily removed in version 3.0.0, and there is no replacement API at this time. This functionality will be re-enabled in future versions. Please follow the SDK release notes for updates.
Newly deprecated APIs (recommended to migrate)
ZIM message receive callback APIs
The onPeerMessageReceived, onRoomMessageReceived, and onGroupMessageReceived callbacks have been marked as deprecated in this version. They can still be used normally at present, but it is recommended to migrate to onMessageReceived as soon as possible.
Recommended (new API)
@Override
public void onMessageReceived(ZIM zim, ZIMMessageReceivedEventResult result) {
List<ZIMMessage> messageList = result.messageList;
ZIMMessageReceivedInfo info = result.info;
String conversationID = result.conversationID;
ZIMConversationType conversationType = result.conversationType;
// Handle messages for different conversation types based on conversationType
}
@Override
public void onMessageReceived(ZIM zim, ZIMMessageReceivedEventResult result) {
List<ZIMMessage> messageList = result.messageList;
ZIMMessageReceivedInfo info = result.info;
String conversationID = result.conversationID;
ZIMConversationType conversationType = result.conversationType;
// Handle messages for different conversation types based on conversationType
}
Recommended (new API)
virtual void onMessageReceived(ZIM *zim,
const ZIMMessageReceivedEventResult &result) override {
auto &messageList = result.messageList;
auto &info = result.info;
auto &conversationID = result.conversationID;
auto conversationType = result.conversationType;
// Handle messages for different conversation types based on conversationType
}
virtual void onMessageReceived(ZIM *zim,
const ZIMMessageReceivedEventResult &result) override {
auto &messageList = result.messageList;
auto &info = result.info;
auto &conversationID = result.conversationID;
auto conversationType = result.conversationType;
// Handle messages for different conversation types based on conversationType
}
ZIMGroupConversation deprecated
The ZIMGroupConversation class has been deprecated in 3.0.0. The isDisabled and mutedExpiredTime fields should be replaced with the corresponding properties of the base class ZIMConversation:
ZIMGroupConversation (deprecated)
ZIMConversation (replacement property)
isDisabled
isConversationDisabled
mutedExpiredTime
selfMutedExpiredTime
New version usage
boolean isDisabled = conversation.isConversationDisabled;
long mutedExpiredTime = conversation.selfMutedExpiredTime;
boolean isDisabled = conversation.isConversationDisabled;
long mutedExpiredTime = conversation.selfMutedExpiredTime;
New version usage
bool isDisabled = conversation.isConversationDisabled;
long long mutedExpiredTime = conversation.selfMutedExpiredTime;
bool isDisabled = conversation.isConversationDisabled;
long long mutedExpiredTime = conversation.selfMutedExpiredTime;
Enum value removals
ZIMMessageType enum value removed
SYSTEM (value 30) has been removed from the ZIMMessageType enum, and the ZIMSystemMessage class has also been removed. If you need to send system-level commands, please use ZIMCommandMessage instead.
New version usage
// Use ZIMCommandMessage instead of ZIMSystemMessage
ZIMCommandMessage commandMessage = new ZIMCommandMessage();
commandMessage.message = "payload".getBytes(StandardCharsets.UTF_8);
zim.sendMessage(commandMessage, "toConversationID", ZIMConversationType.PEER,
new ZIMMessageSendConfig(), null, new ZIMMessageSentFullCallback() {
@Override
public void onMessageSent(ZIMMessage message, ZIMError errorInfo) {}
@Override
public void onMessageAttached(ZIMMessage message) {}
});
// Use ZIMCommandMessage instead of ZIMSystemMessage
ZIMCommandMessage commandMessage = new ZIMCommandMessage();
commandMessage.message = "payload".getBytes(StandardCharsets.UTF_8);
zim.sendMessage(commandMessage, "toConversationID", ZIMConversationType.PEER,
new ZIMMessageSendConfig(), null, new ZIMMessageSentFullCallback() {
@Override
public void onMessageSent(ZIMMessage message, ZIMError errorInfo) {}
@Override
public void onMessageAttached(ZIMMessage message) {}
});
New version usage
// Use ZIMCommandMessage instead of ZIMSystemMessage
auto commandMessage = std::make_shared<ZIMCommandMessage>();
commandMessage->message = {/* payload bytes */};
zim->sendMessage(commandMessage, "toConversationID",
ZIMConversationType::ZIM_CONVERSATION_TYPE_PEER,
ZIMMessageSendConfig{}, nullptr,
[=](const std::shared_ptr<ZIMMessage> &msg, const ZIMError &errorInfo) {});
// Use ZIMCommandMessage instead of ZIMSystemMessage
auto commandMessage = std::make_shared<ZIMCommandMessage>();
commandMessage->message = {/* payload bytes */};
zim->sendMessage(commandMessage, "toConversationID",
ZIMConversationType::ZIM_CONVERSATION_TYPE_PEER,
ZIMMessageSendConfig{}, nullptr,
[=](const std::shared_ptr<ZIMMessage> &msg, const ZIMError &errorInfo) {});
ZIMCallUserState enum value removed
OFFLINE (value 4) has been removed from the ZIMCallUserState enum. Please check your code for any references to this enum value and remove them.
// The following enum value has been removed, please check and remove references to this value in your code
// ZIMCallUserState.OFFLINE (value 4)
// The following enum value has been removed, please check and remove references to this value in your code
// ZIMCallUserState.OFFLINE (value 4)
// The following enum value has been removed, please check and remove references to this value in your code
// ZIMCallUserState::ZIM_CALL_USER_STATE_OFFLINE (value 4)
// The following enum value has been removed, please check and remove references to this value in your code
// ZIMCallUserState::ZIM_CALL_USER_STATE_OFFLINE (value 4)
Field changes
ZIMUserFullInfo.userAvatarUrl deprecated
ZIMUserFullInfo.userAvatarUrl has been deprecated. Please use ZIMUserFullInfo.baseInfo.userAvatarUrl instead.
The ZIMGroupOperatedInfo.operatedUserInfo field has been removed. Its internal fields have been flattened into ZIMGroupOperatedInfo, and can be accessed directly from ZIMGroupOperatedInfo.
New version usage
// Get fields directly from ZIMGroupOperatedInfo
String operatorUserID = groupOperatedInfo.userID;
String operatorUserName = groupOperatedInfo.userName;
String operatorAvatarUrl = groupOperatedInfo.userAvatarUrl;
// Get fields directly from ZIMGroupOperatedInfo
String operatorUserID = groupOperatedInfo.userID;
String operatorUserName = groupOperatedInfo.userName;
String operatorAvatarUrl = groupOperatedInfo.userAvatarUrl;
New version usage
// Get fields directly from ZIMGroupOperatedInfo
std::string operatorUserID = groupOperatedInfo.userID;
std::string operatorUserName = groupOperatedInfo.userName;
std::string operatorAvatarUrl = groupOperatedInfo.userAvatarUrl;
// Get fields directly from ZIMGroupOperatedInfo
std::string operatorUserID = groupOperatedInfo.userID;
std::string operatorUserName = groupOperatedInfo.userName;
std::string operatorAvatarUrl = groupOperatedInfo.userAvatarUrl;
ZIMCallInvitationSentInfo.errorInvitees replaced
ZIMCallInvitationSentInfo.errorInvitees has been removed. Please use ZIMCallInvitationSentInfo.errorUserList instead. The type has changed from List<ZIMCallUserInfo> to List<ZIMErrorUserInfo>.
New version usage
zim.callInvite(invitees, config, new ZIMCallInvitationSentCallback() {
@Override
public void onCallInvitationSent(String callID,
ZIMCallInvitationSentInfo info, ZIMError error) {
for (ZIMErrorUserInfo errorUser : info.errorUserList) {
// errorUser.userID, errorUser.reason
}
}
});
zim.callInvite(invitees, config, new ZIMCallInvitationSentCallback() {
@Override
public void onCallInvitationSent(String callID,
ZIMCallInvitationSentInfo info, ZIMError error) {
for (ZIMErrorUserInfo errorUser : info.errorUserList) {
// errorUser.userID, errorUser.reason
}
}
});
The event property (type ZIMConversationEvent) in ZIMConversationChangeInfo has been removed. Please use the action property (type ZIMConversationChangeAction) in the same structure instead.
New version usage
@Override
public void onConversationChanged(ZIM zim, ZIMConversationChangeEventResult result) {
for (ZIMConversationChangeInfo changeInfo : result.infoList) {
ZIMConversationChangeAction action = changeInfo.action;
// Handle conversation changes based on action
}
}
@Override
public void onConversationChanged(ZIM zim, ZIMConversationChangeEventResult result) {
for (ZIMConversationChangeInfo changeInfo : result.infoList) {
ZIMConversationChangeAction action = changeInfo.action;
// Handle conversation changes based on action
}
}
New version usage
virtual void onConversationChanged(ZIM *zim,
const ZIMConversationChangeEventResult &result) override {
for (const auto &changeInfo : result.infoList) {
ZIMConversationChangeAction action = changeInfo.action;
// Handle conversation changes based on action
}
}
virtual void onConversationChanged(ZIM *zim,
const ZIMConversationChangeEventResult &result) override {
for (const auto &changeInfo : result.infoList) {
ZIMConversationChangeAction action = changeInfo.action;
// Handle conversation changes based on action
}
}
API naming and signature changes
The following changes in 3.0.0 may cause compilation errors. Please make the corresponding modifications as prompted.
ZIMMessage getter method renames
The following getter methods in ZIMMessage have been renamed. After upgrading, you need to update the calling methods accordingly:
The following callback methods in Callback interfaces have been renamed. When implementing these interfaces, you need to update the method names accordingly:
Interface class
Old method name
New method name
ZIMUserOfflinePushRuleUpdatedCallback
onUserOfflinePushRuleInfoUpdated
onUserOfflinePushRuleUpdated
ZIMMessageLocalExtendedDataUpdatedCallback
onMessageExtendedDataUpdated
onMessageLocalExtendedData
ZIMGroupMemberMutedListQueriedCallback
onGroupMemberListQueried
onGroupMemberMutedListQueried
ZIMFriendAddCallback
onFriendAddedCallback
onFriendAdded
ZIMFriendApplicationSentCallback
onFriendApplicationSentCallback
onFriendApplicationSent
ZIMFriendsDeletedCallback
onFriendsDeletedCallback
onFriendsDeleted
ZIMFriendsRelationCheckedCallback
onFriendsChecked
onFriendsReactionChecked
New version usage (using ZIMFriendAddCallback as an example)
zim.addFriend("targetUserID", config, new ZIMFriendAddCallback() {
@Override
public void onFriendAdded(ZIMFriendInfo friendInfo, ZIMError error) {
// Handle add friend result
}
});
zim.addFriend("targetUserID", config, new ZIMFriendAddCallback() {
@Override
public void onFriendAdded(ZIMFriendInfo friendInfo, ZIMError error) {
// Handle add friend result
}
});
Class serialization method change
The following classes and all their subclasses no longer implement the Serializable interface. If you previously passed these objects through Intent, please use the SDK-provided toBundle() and fromBundle() methods instead:
ZIMMessage and its subclasses
ZIMMessageLiteInfo and its subclasses
ZIMUserInfo and its subclasses
ZIMTipsMessageChangeInfo and its subclasses
ZIMConversation and its subclasses
New version usage
// Sender: write object to Intent via toBundle()
Intent intent = new Intent(this, TargetActivity.class);
intent.putExtra("message_bundle", message.toBundle());
startActivity(intent);
// Receiver: restore object from Bundle via fromBundle()
Bundle bundle = getIntent().getBundleExtra("message_bundle");
ZIMMessage message = ZIMMessage.fromBundle(bundle);
// Sender: write object to Intent via toBundle()
Intent intent = new Intent(this, TargetActivity.class);
intent.putExtra("message_bundle", message.toBundle());
startActivity(intent);
// Receiver: restore object from Bundle via fromBundle()
Bundle bundle = getIntent().getBundleExtra("message_bundle");
ZIMMessage message = ZIMMessage.fromBundle(bundle);
Callback signature changes
The parameter signatures of the following event callbacks have changed. You need to update the implementation code accordingly:
The rootRepliedCount field type of ZIMMessage has changed from int to unsigned int. Please check your code for any logic involving assignment or comparison with signed integers for this field to avoid type conversion issues.
New version usage
unsigned int count = message->rootRepliedCount;
unsigned int count = message->rootRepliedCount;
Other method renames
ZIMTipsMessagePinStatusChangeInfo — isPinned() renamed to getIsPinned():
int width = imageMessage->getThumbnailWidth();
int height = imageMessage->getThumbnailHeight();
int width = imageMessage->getThumbnailWidth();
int height = imageMessage->getThumbnailHeight();
Enum value renames
The following enum values have been renamed in 3.0.0. After upgrading, please check and replace all related references in your code.
ZIMCallUserState
ZIMCallUserState.QUITED has been renamed to ZIMCallUserState.QUIT.
New version usage
if (userState == ZIMCallUserState.QUIT) {
// User has quit the call
}
if (userState == ZIMCallUserState.QUIT) {
// User has quit the call
}
ZIMMediaFileType
ZIMMediaFileType.THUMBNAIL_IMAGE has been renamed to ZIMMediaFileType.THUMBNAIL. Please check and replace the enum values passed when calling APIs like downloadMediaFile.
ZIMGroupMessageNotificationStatus.DISTURB has been renamed to ZIMGroupMessageNotificationStatus.DO_NOT_DISTURB.
New version usage
ZIMGroupMessageNotificationStatus status = ZIMGroupMessageNotificationStatus.DO_NOT_DISTURB;
ZIMGroupMessageNotificationStatus status = ZIMGroupMessageNotificationStatus.DO_NOT_DISTURB;
setRoomMembersAttributes behavior change
Starting from version 3.0.0, when setting room member attributes via setRoomMembersAttributes, if isDeleteAfterOwnerLeft is false, the room member attributes will not be deleted when the user leaves the room. In versions 2.x.x, attributes were first deleted when the user left the room and then restored when the user returned.
2.28.0 Upgrade Guide
Warning
ZIM SDK 2.28.0 version adjusts some return parameters and event callback triggering mechanisms. When upgrading from an older version to 2.28.0, please read the following guidelines.
Interface return parameter changes
ZIMMessageReactionUserListQueriedCallback callback will return the user reaction detail list type from ZIMMessageReactionUserInfo to ZIMMessageReactionUserFullInfo, which can be used for more detailed business UI display.
Usage in Version 2.28.0
zim.queryMessageReactionUserList(message, config, new ZIMMessageReactionUserListQueriedCallback() {
@Override
public void onMessageReactionUserListQueried(
// !mark
ZIMMessage message, ArrayList<ZIMMessageReactionUserFullInfo> userInfoList,
String reactionType, long nextFlag, int totalCount, ZIMError error) {
// Do business logic
}
});
zim.queryMessageReactionUserList(message, config, new ZIMMessageReactionUserListQueriedCallback() {
@Override
public void onMessageReactionUserListQueried(
// !mark
ZIMMessage message, ArrayList<ZIMMessageReactionUserFullInfo> userInfoList,
String reactionType, long nextFlag, int totalCount, ZIMError error) {
// Do business logic
}
});
Usage in Version 2.28.0
zim->queryMessageReactionUserList(message, config,
[=](const std::shared_ptr<ZIMMessage> &message,
// !mark
const std::vector<ZIMMessageReactionUserFullInfo> &userInfoList,
const std::string &reactionType, const long long nextFlag,
const unsigned int totalCount, const ZIMError &errorInfo) {
// Do business logic
});
zim->queryMessageReactionUserList(message, config,
[=](const std::shared_ptr<ZIMMessage> &message,
// !mark
const std::vector<ZIMMessageReactionUserFullInfo> &userInfoList,
const std::string &reactionType, const long long nextFlag,
const unsigned int totalCount, const ZIMError &errorInfo) {
// Do business logic
});
Event callback triggering mechanism changes
Warning
The following callbacks have changed the triggering mechanism since version 2.28.0. It is recommended that developers check whether the corresponding business logic is affected after upgrading the SDK.
Starting from version 2.27.0, the following interfaces have undergone significant changes. Therefore, when upgrading from an earlier version to 2.27.0, please read the following guidelines.
queryGroupList and related callbacks
The original queryGroupList interface now has an overloaded interface queryGroupList as a replacement. The new version of queryGroupList adds the count and config parameters, which can be used to query the list of groups that you have joined together.
The ZIMGroupListQueriedCallback callback adds the nextFlag parameter, which can be used as an anchor for paginated queries.
Usage in Version 2.27.0 (Query All Group List)
zim.queryGroupList(new ZIMGroupListQueriedCallback() {
@Override
public void onGroupListQueried(ArrayList<ZIMGroupInfo> groupList, long nextFlag, ZIMError errorInfo) {
// Use errorInfo.code to obtain the result of groups the user has joined
}
});
zim.queryGroupList(new ZIMGroupListQueriedCallback() {
@Override
public void onGroupListQueried(ArrayList<ZIMGroupInfo> groupList, long nextFlag, ZIMError errorInfo) {
// Use errorInfo.code to obtain the result of groups the user has joined
}
});
Usage in Version 2.27.0 (Query All Group List)
zim_->queryGroupList(
[=](const std::vector<ZIMGroupInfo> &groupList, long long nextFlag, zim::ZIMError errorInfo){
int error_code = errorInfo.code;
});
zim_->queryGroupList(
[=](const std::vector<ZIMGroupInfo> &groupList, long long nextFlag, zim::ZIMError errorInfo){
int error_code = errorInfo.code;
});
2.19.0 upgrade guide
Warning
Starting from version 2.19.0, the following interfaces have undergone significant changes. Therefore, when upgrading from an older version to version 2.19.0, please read the following guidelines.
downloadMediaFile and related callbacks
The original downloadMediaFile API is deprecated. Please use the new downloadMediaFile instead. The updated downloadMediaFile introduces a new config parameter, which can be used to specify the download of individual media content in multi-item messages.
The ZIMMediaDownloadedCallback callback has been updated to support multi-item messages. Developers need to fix the calls according to the IDE's compile error hints:
The message parameter in onMediaDownloaded has changed from ZIMMediaMessage to ZIMMessage.
In ZIMMediaDownloadingProgress and ZIMMediaDownloadedCallback, the message parameter type has changed from const std::shared_ptr<ZIMMediaMessage> & to const std::shared_ptr<ZIMMessage> & to support multi-item messages. Developers need to fix the calls according to the IDE's compile error hints.
In ZIMMediaDownloadingProgress and ZIMMediaDownloadedResult, the parameter message type has changed from ZIMMediaMessage to ZIMMessage to support composite messages. TypeScript developers need to update their code based on the compilation error messages from their IDE.
Usage in Version 2.19.0(For Multi-item Messages)
// Assume multipleMessage.messageInfoList[0] is a text message, and multipleMessage.messageInfoList[1] is an image message
ZIMMultipleMessage multipleMessage = (ZIMMultipleMessage) message;
// !mark(1:3)
ZIMMediaDownloadConfig config = new ZIMMediaDownloadConfig();
// Specify to download the image message
config.messageInfoIndex = 1;
// !mark
zim.getInstance().downloadMediaFile(multipleMessage, ZIMMediaFileType.ORIGINAL_FILE, config, new ZIMMediaDownloadedCallback() {
@Override
// !mark
public void onMediaDownloadingProgress(ZIMMessage message, long currentFileSize, long totalFileSize) {
// Download progress
// Developers need to check the type of the message and cast it to the corresponding message type
if (message instanceof ZIMMultipleMessage) {
ZIMMultipleMessage multipleMessage = (ZIMMultipleMessage) message;
// Handle multi-item messages
}
// Handle other types of messages
......
}
@Override
// !mark
public void onMediaDownloaded(ZIMMessage message, ZIMError errorInfo) {
// Download complete
// Developers need to check the type of the message and cast it to the corresponding message type
if (message instanceof ZIMMultipleMessage) {
ZIMMultipleMessage multipleMessage = (ZIMMultipleMessage) message;
// Handle multi-item messages
}
// Handle other types of messages
......
}
});
// Assume multipleMessage.messageInfoList[0] is a text message, and multipleMessage.messageInfoList[1] is an image message
ZIMMultipleMessage multipleMessage = (ZIMMultipleMessage) message;
// !mark(1:3)
ZIMMediaDownloadConfig config = new ZIMMediaDownloadConfig();
// Specify to download the image message
config.messageInfoIndex = 1;
// !mark
zim.getInstance().downloadMediaFile(multipleMessage, ZIMMediaFileType.ORIGINAL_FILE, config, new ZIMMediaDownloadedCallback() {
@Override
// !mark
public void onMediaDownloadingProgress(ZIMMessage message, long currentFileSize, long totalFileSize) {
// Download progress
// Developers need to check the type of the message and cast it to the corresponding message type
if (message instanceof ZIMMultipleMessage) {
ZIMMultipleMessage multipleMessage = (ZIMMultipleMessage) message;
// Handle multi-item messages
}
// Handle other types of messages
......
}
@Override
// !mark
public void onMediaDownloaded(ZIMMessage message, ZIMError errorInfo) {
// Download complete
// Developers need to check the type of the message and cast it to the corresponding message type
if (message instanceof ZIMMultipleMessage) {
ZIMMultipleMessage multipleMessage = (ZIMMultipleMessage) message;
// Handle multi-item messages
}
// Handle other types of messages
......
}
});
Usage in Version 2.19.0(For Multi-item Messages)
// Assume multipleMessage.messageInfoList[0] is a text message, and multipleMessage.messageInfoList[1] is an image message
auto multipleMessage = std::static_pointer_cast<ZIMMultipleMessage>(message);
// !mark(1:3)
ZIMMediaDownloadConfig config;
// Specify to download the image message
config.messageInfoIndex = 1;
ZIM::getInstance()->downloadMediaFile(multipleMessage,
ZIMMediaFileType::ZIM_MEDIA_FILE_TYPE_ORIGINAL_FILE,
// !mark(1:2)
config,
[=](const std::shared_ptr<ZIMMessage> &message, unsigned long long currentFileSize, unsigned long long totalFileSize) {
// Download Progress
// Developers need to check the type of the message and cast it to the corresponding message type
if (message->getType() == ZIMMessageType::ZIM_MESSAGE_TYPE_MULTIPLE) {
auto multipleMessage = std::static_pointer_cast<ZIMMultipleMessage>(message);
// Handle multi-item messages
}
// Handle other message types
......
},
// !mark
[=](const std::shared_ptr<ZIMMessage> &message, const ZIMError &errorInfo) {
// Download completed
// Developers need to check the type of the message and cast it to the corresponding message type
if (message->getType() == ZIMMessageType::ZIM_MESSAGE_TYPE_MULTIPLE) {
auto multipleMessage = std::static_pointer_cast<ZIMMultipleMessage>(message);
// Handle multi-item messages
}
// Handle other message types
......
});
// Assume multipleMessage.messageInfoList[0] is a text message, and multipleMessage.messageInfoList[1] is an image message
auto multipleMessage = std::static_pointer_cast<ZIMMultipleMessage>(message);
// !mark(1:3)
ZIMMediaDownloadConfig config;
// Specify to download the image message
config.messageInfoIndex = 1;
ZIM::getInstance()->downloadMediaFile(multipleMessage,
ZIMMediaFileType::ZIM_MEDIA_FILE_TYPE_ORIGINAL_FILE,
// !mark(1:2)
config,
[=](const std::shared_ptr<ZIMMessage> &message, unsigned long long currentFileSize, unsigned long long totalFileSize) {
// Download Progress
// Developers need to check the type of the message and cast it to the corresponding message type
if (message->getType() == ZIMMessageType::ZIM_MESSAGE_TYPE_MULTIPLE) {
auto multipleMessage = std::static_pointer_cast<ZIMMultipleMessage>(message);
// Handle multi-item messages
}
// Handle other message types
......
},
// !mark
[=](const std::shared_ptr<ZIMMessage> &message, const ZIMError &errorInfo) {
// Download completed
// Developers need to check the type of the message and cast it to the corresponding message type
if (message->getType() == ZIMMessageType::ZIM_MESSAGE_TYPE_MULTIPLE) {
auto multipleMessage = std::static_pointer_cast<ZIMMultipleMessage>(message);
// Handle multi-item messages
}
// Handle other message types
......
});
title="Usage in Version 2.19.0(For Multi-item Messages)
// Assume multipleMessage.messageInfoList[0] is a text message, and multipleMessage.messageInfoList[1] is an image message
const multipleMessage: ZIMMessage = {
type: 10,
messageInfoList: [
{ type: 1, message: "Hello, World!" },
{ type: 11, fileLocalPath: '' }
]
}
const config: ZIMMediaDownloadConfig = {
// Specify to download the image message
messageInfoIndex: 1
}
// !mark(1:4)
zim.downloadMediaFile(multipleMessage, 1, config, (message: ZIMMessage, currentFileSize: number, totalFileSize: number) => {
// Download progress
// Developers need to check the type of the message and cast it to the corresponding message type
if (message.type === 10) {
// !mark
const multipleMessage: ZIMMultipleMessage = message as ZIMMultipleMessage
// Handle multi-item messages
}
// Handle other types of messages
......
}).then((message: ZIMMessage) => {
// Download complete
// Developers need to check the type of the message and cast it to the corresponding message type
if (message.type === 10) {
// !mark
const multipleMessage: ZIMMultipleMessage = message as ZIMMultipleMessage
// Handle multi-item messages
}
// Handle other types of messages
......
}).catch((errorInfo) => {
// Failed to download
})
// Assume multipleMessage.messageInfoList[0] is a text message, and multipleMessage.messageInfoList[1] is an image message
const multipleMessage: ZIMMessage = {
type: 10,
messageInfoList: [
{ type: 1, message: "Hello, World!" },
{ type: 11, fileLocalPath: '' }
]
}
const config: ZIMMediaDownloadConfig = {
// Specify to download the image message
messageInfoIndex: 1
}
// !mark(1:4)
zim.downloadMediaFile(multipleMessage, 1, config, (message: ZIMMessage, currentFileSize: number, totalFileSize: number) => {
// Download progress
// Developers need to check the type of the message and cast it to the corresponding message type
if (message.type === 10) {
// !mark
const multipleMessage: ZIMMultipleMessage = message as ZIMMultipleMessage
// Handle multi-item messages
}
// Handle other types of messages
......
}).then((message: ZIMMessage) => {
// Download complete
// Developers need to check the type of the message and cast it to the corresponding message type
if (message.type === 10) {
// !mark
const multipleMessage: ZIMMultipleMessage = message as ZIMMultipleMessage
// Handle multi-item messages
}
// Handle other types of messages
......
}).catch((errorInfo) => {
// Failed to download
})
sendMessage
The sendMediaMessage and the old sendMessage methods are deprecated. A new sendMessage method is introduced, which supports sending any type of message.
The callback for sendMessage is different from the callback of the old method with the same name. It has changed from ZIMMediaMessageSentCallback to ZIMMessageSentFullCallback.
In ZIMMessageSentFullCallback, the message parameter in onMediaUploadingProgress has changed from ZIMMessage to ZIMMediaMessage to ensure that only media messages are notified in the callback. Developers need to fix the calls according to the compile error hints from the IDE. (Currently, only developers using the replyMessage interface will be affected by the need to resolve compile errors.)
Usage in Version 2.19.0
ZIMImageMessage imageMessage = (ZIMImageMessage) message;
// !mark
zim.getInstance().sendMessage(imageMessage, "TO_CONVERSATION_ID", ZIMConversationType.PEER, new ZIMMessageSentFullCallback() {
@Override
public void onMessageSent(ZIMMessage message, ZIMError errorInfo) {
// Message send result
}
@Override
// !mark
public void onMediaUploadingProgress(ZIMMediaMessage message, long currentFileSize, long totalFileSize) {
// Multimedia upload progress
}
@Override
public void onMessageAttached(ZIMMessage message) {
// Developers can listen to this callback to execute business logic before sending the message
}
});
ZIMImageMessage imageMessage = (ZIMImageMessage) message;
// !mark
zim.getInstance().sendMessage(imageMessage, "TO_CONVERSATION_ID", ZIMConversationType.PEER, new ZIMMessageSentFullCallback() {
@Override
public void onMessageSent(ZIMMessage message, ZIMError errorInfo) {
// Message send result
}
@Override
// !mark
public void onMediaUploadingProgress(ZIMMediaMessage message, long currentFileSize, long totalFileSize) {
// Multimedia upload progress
}
@Override
public void onMessageAttached(ZIMMessage message) {
// Developers can listen to this callback to execute business logic before sending the message
}
});
sendMediaMessage
Since version 2.19.0, multimedia messages must be sent using the sendMessage interface. The sendMediaMessage interface is deprecated to unify message sending and facilitate future general extensions.
In ZIMMessageSendNotification, the message parameter type in the onMediaUploadingProgress callback method has changed from ZIMMessage to ZIMMediaMessage to ensure that only media messages are notified in the callback. TypeScript developers need to fix the calls based on the compile error hints from the IDE. (Currently, only developers using TypeScript and the replyMessage interface will be affected by the need to resolve compile errors.)
Usage in Version 2.19.0
auto imageMessage = std::static_pointer_cast<ZIMImageMessage>(message);
ZIMMessageSendConfig config;
config.priority = ZIMMessagePriority::ZIM_MESSAGE_PRIORITY_MEDIUM;
// !mark
auto notification = std::make_shared<ZIMMessageSendNotification>();
notification->onMessageAttached = [=](const std::shared_ptr<ZIMMessage> &message) {
// Developers can listen to this callback to execute business logic before sending the message
};
notification->onMediaUploadingProgress = [=](const std::shared_ptr<ZIMMediaMessage> &message, unsigned long long currentFileSize, unsigned long long totalFileSize) {
// Upload Progress
};
// !mark
ZIM::getInstance()->sendMessage(imageMessage,
"TO_CONVERSATION_ID",
ZIMConversationType::ZIM_CONVERSATION_TYPE_PEER,
config,
notification,
[=](const std::shared_ptr<ZIMMessage> &message, const ZIMError &errorInfo) {
// Message Send Result
});
auto imageMessage = std::static_pointer_cast<ZIMImageMessage>(message);
ZIMMessageSendConfig config;
config.priority = ZIMMessagePriority::ZIM_MESSAGE_PRIORITY_MEDIUM;
// !mark
auto notification = std::make_shared<ZIMMessageSendNotification>();
notification->onMessageAttached = [=](const std::shared_ptr<ZIMMessage> &message) {
// Developers can listen to this callback to execute business logic before sending the message
};
notification->onMediaUploadingProgress = [=](const std::shared_ptr<ZIMMediaMessage> &message, unsigned long long currentFileSize, unsigned long long totalFileSize) {
// Upload Progress
};
// !mark
ZIM::getInstance()->sendMessage(imageMessage,
"TO_CONVERSATION_ID",
ZIMConversationType::ZIM_CONVERSATION_TYPE_PEER,
config,
notification,
[=](const std::shared_ptr<ZIMMessage> &message, const ZIMError &errorInfo) {
// Message Send Result
});
Starting from version 2.18.0, the following interfaces have undergone significant changes. Therefore, when upgrading from an older version to version 2.18.0, please read the following guidelines.
Callback on receiving one-to-one messages
The deprecated callback onReceivePeerMessage for receiving one-to-one messages has been replaced by onPeerMessageReceived.
The deprecated callback receivePeerMessage for receiving one-to-one messages has been replaced by peerMessageReceived.
The new callback supports the following features:
When a user is online, they can receive one-to-one messages through this callback.
When a user logs back into the ZIM SDK, they can receive all one-to-one messages received during their offline period (up to 7 days).
// New callback
public void onPeerMessageReceived(ZIM zim, ArrayList<ZIMMessage> messageList,
ZIMMessageReceivedInfo info, String fromUserID) {}
// Old callback
public void onReceivePeerMessage(ZIM zim, ArrayList<ZIMMessage> messageList,
String fromUserID) {}
// New callback
public void onPeerMessageReceived(ZIM zim, ArrayList<ZIMMessage> messageList,
ZIMMessageReceivedInfo info, String fromUserID) {}
// Old callback
public void onReceivePeerMessage(ZIM zim, ArrayList<ZIMMessage> messageList,
String fromUserID) {}
// New callback
peerMessageReceived: (zim: ZIM, data: ZIMEventOfConversationMessageReceivedResult) => void;
// Old callback
receivePeerMessage: (zim: ZIM, data: ZIMEventOfReceiveConversationMessageResult) => void;
// New callback
peerMessageReceived: (zim: ZIM, data: ZIMEventOfConversationMessageReceivedResult) => void;
// Old callback
receivePeerMessage: (zim: ZIM, data: ZIMEventOfReceiveConversationMessageResult) => void;
Callback on receiving room messages
The deprecated callback onReceiveRoomMessage for receiving room messages has been replaced by onRoomMessageReceived.
The deprecated callback receiveRoomMessage for receiving room messages has been replaced by roomMessageReceived.
The new callback supports the following features:
When a user is online, they can receive online room messages through this callback.
When a user goes from offline to online and is still in the room, they can receive all room messages that were sent during their offline period through this callback.
// New callback
public void onRoomMessageReceived(ZIM zim, ArrayList<ZIMMessage> messageList,
ZIMMessageReceivedInfo info, String fromRoomID) {}
// Old callback
public void onReceiveRoomMessage(ZIM zim, ArrayList<ZIMMessage> messageList,
String fromRoomID) {}
// New callback
public void onRoomMessageReceived(ZIM zim, ArrayList<ZIMMessage> messageList,
ZIMMessageReceivedInfo info, String fromRoomID) {}
// Old callback
public void onReceiveRoomMessage(ZIM zim, ArrayList<ZIMMessage> messageList,
String fromRoomID) {}
// New callback
roomMessageReceived: (zim: ZIM, data: ZIMEventOfConversationMessageReceivedResult) => void;
// Old callback
receiveRoomMessage: (zim: ZIM, data: ZIMEventOfReceiveConversationMessageResult) => void;
// New callback
roomMessageReceived: (zim: ZIM, data: ZIMEventOfConversationMessageReceivedResult) => void;
// Old callback
receiveRoomMessage: (zim: ZIM, data: ZIMEventOfReceiveConversationMessageResult) => void;
Callback on receiving group messages
The deprecated callback onReceiveGroupMessage for receiving group messages has been replaced by onGroupMessageReceived.
The deprecated callback receiveGroupMessage for receiving group messages has been replaced by groupMessageReceived.
The new callback supports the following features:
When the user is online, they can receive online group messages through this callback.
When the user logs back into the ZIM SDK, they can receive all group chat messages received during the offline period (up to 7 days) through this callback.
// New callback
public void onGroupMessageReceived(ZIM zim, ArrayList<ZIMMessage> messageList,
ZIMMessageReceivedInfo info, String fromGroupID) {}
// Old callback
public void onReceiveGroupMessage(ZIM zim, ArrayList<ZIMMessage> messageList,
String fromGroupID) {}
// New callback
public void onGroupMessageReceived(ZIM zim, ArrayList<ZIMMessage> messageList,
ZIMMessageReceivedInfo info, String fromGroupID) {}
// Old callback
public void onReceiveGroupMessage(ZIM zim, ArrayList<ZIMMessage> messageList,
String fromGroupID) {}
// New callback
groupMessageReceived: (zim: ZIM, data: ZIMEventOfConversationMessageReceivedResult) => void;
// Old callback
receiveGroupMessage: (zim: ZIM, data: ZIMEventOfReceiveConversationMessageResult) => void;
// New callback
groupMessageReceived: (zim: ZIM, data: ZIMEventOfConversationMessageReceivedResult) => void;
// Old callback
receiveGroupMessage: (zim: ZIM, data: ZIMEventOfReceiveConversationMessageResult) => void;
2.16.0 Upgrade Guide
Warning
Starting from version 2.16.0, there are significant changes to the following interfaces. Therefore, when upgrading from an older version to version 2.16.0, please read the following guide.
callCancel
Note
The following changes only apply to advanced mode call invitations.
In the new version of callCancel, if the parameter userIDs contains a userID, this interface will only cancel the invitation for that callee. If the userIDs parameter is empty, this interface will cancel the invitation for all callees.
For the old version of the callCancel interface, regardless of whether the userIDs parameter is empty or not, it is considered as canceling the invitation for all callees.
Since the old version of the ZIM SDK is not compatible with separate cancellation logic, if you need to retain the cancellation logic implemented using the old version of ZIM and also need to use the separate cancellation feature of the new version, please isolate the call functionality between the old and new versions of ZIM.
Usage in 2.16.0 version
// Cancel userIdA and userIdB separately
List<String> invitees = new ArrayList<>();
invitees.add("userIdA");
invitees.add("userIdB");
ZIMCallCancelConfig cancelConfig = new ZIMCallCancelConfig();
ZIM.getInstance().callCancel(invitees, "callID", cancelConfig, new ZIMCallCancelSentCallback() {
@Override
public void onCallCancelSent(String callID, ArrayList<String> errorInvitees, ZIMError errorInfo) {
}
});;
// Cancel the entire call invitation, can be called successfully when none of the callees in the entire call have accepted
List<String> invitees = new ArrayList<>();
ZIMCallCancelConfig cancelConfig = new ZIMCallCancelConfig();
ZIM.getInstance().callCancel(invitees, "callID", cancelConfig, new ZIMCallCancelSentCallback() {
@Override
public void onCallCancelSent(String callID, ArrayList<String> errorInvitees, ZIMError errorInfo) {
}
});
// Cancel userIdA and userIdB separately
List<String> invitees = new ArrayList<>();
invitees.add("userIdA");
invitees.add("userIdB");
ZIMCallCancelConfig cancelConfig = new ZIMCallCancelConfig();
ZIM.getInstance().callCancel(invitees, "callID", cancelConfig, new ZIMCallCancelSentCallback() {
@Override
public void onCallCancelSent(String callID, ArrayList<String> errorInvitees, ZIMError errorInfo) {
}
});;
// Cancel the entire call invitation, can be called successfully when none of the callees in the entire call have accepted
List<String> invitees = new ArrayList<>();
ZIMCallCancelConfig cancelConfig = new ZIMCallCancelConfig();
ZIM.getInstance().callCancel(invitees, "callID", cancelConfig, new ZIMCallCancelSentCallback() {
@Override
public void onCallCancelSent(String callID, ArrayList<String> errorInvitees, ZIMError errorInfo) {
}
});
Usage in version 2.16.0
// Cancel userIdA and userIdB separately
std::vector<std::string> invitees;
invitees.emplace_back("userIdA");
invitees.emplace_back("userIdB");
ZIMCallCancelConfig config;
zim->callCancel(invitees, "callID", config, [=](const std::string& callID, const std::vector<std::string>& errorInvitees,
const ZIMError& errorInfo) {
});
// Cancel the entire call invitation, can be called successfully when none of the callees in the call have accepted
std::vector<std::string> invitees;
ZIMCallCancelConfig config;
zim->callCancel(invitees, "callID", config, [=](const std::string& callID, const std::vector<std::string>& errorInvitees,
const ZIMError& errorInfo) {
});
// Cancel userIdA and userIdB separately
std::vector<std::string> invitees;
invitees.emplace_back("userIdA");
invitees.emplace_back("userIdB");
ZIMCallCancelConfig config;
zim->callCancel(invitees, "callID", config, [=](const std::string& callID, const std::vector<std::string>& errorInvitees,
const ZIMError& errorInfo) {
});
// Cancel the entire call invitation, can be called successfully when none of the callees in the call have accepted
std::vector<std::string> invitees;
ZIMCallCancelConfig config;
zim->callCancel(invitees, "callID", config, [=](const std::string& callID, const std::vector<std::string>& errorInvitees,
const ZIMError& errorInfo) {
});
Usage in version 2.16.0
// Cancel userIdA and userIdB separately
const callID = 'xxxx';
const invitees = ['userIdA','userIdB']; // List of invitees' IDs
const config: ZIMCallCancelConfig = { extendedData: 'xxxx' };
zim.callCancel(invitees, callID, config)
.then(res => {
// Operation successful
})
.catch(err => {
// Operation failed
})
// Cancel the entire call invitation, can be called successfully when none of the callees in the call have accepted
const callID = 'xxxx';
const invitees = []; // List of invitees' IDs
const config: ZIMCallCancelConfig = { extendedData: 'xxxx' };
zim.callCancel(invitees, callID, config)
.then(res => {
// Operation successful
})
.catch(err => {
// Operation failed
})
// Cancel userIdA and userIdB separately
const callID = 'xxxx';
const invitees = ['userIdA','userIdB']; // List of invitees' IDs
const config: ZIMCallCancelConfig = { extendedData: 'xxxx' };
zim.callCancel(invitees, callID, config)
.then(res => {
// Operation successful
})
.catch(err => {
// Operation failed
})
// Cancel the entire call invitation, can be called successfully when none of the callees in the call have accepted
const callID = 'xxxx';
const invitees = []; // List of invitees' IDs
const config: ZIMCallCancelConfig = { extendedData: 'xxxx' };
zim.callCancel(invitees, callID, config)
.then(res => {
// Operation successful
})
.catch(err => {
// Operation failed
})
Usage in version 2.16.0
// Cancel userIdA and userIdB separately
var callID = 'xxxx';
var invitees = ['userIdA','userIdB']; // List of invitees' IDs
var config = { extendedData: 'xxxx' };
zim.callCancel(invitees, callID, config)
.then(res => {
// Operation successful
})
.catch(err => {
// Operation failed
})
// Cancel the entire call invitation, can be called successfully when none of the callees in the call have accepted
var callID = 'xxxx';
var invitees = []; // List of invitees' IDs
var config = { extendedData: 'xxxx' };
zim.callCancel(invitees, callID, config)
.then(res => {
// Operation successful
})
.catch(err => {
// Operation failed
})
// Cancel userIdA and userIdB separately
var callID = 'xxxx';
var invitees = ['userIdA','userIdB']; // List of invitees' IDs
var config = { extendedData: 'xxxx' };
zim.callCancel(invitees, callID, config)
.then(res => {
// Operation successful
})
.catch(err => {
// Operation failed
})
// Cancel the entire call invitation, can be called successfully when none of the callees in the call have accepted
var callID = 'xxxx';
var invitees = []; // List of invitees' IDs
var config = { extendedData: 'xxxx' };
zim.callCancel(invitees, callID, config)
.then(res => {
// Operation successful
})
.catch(err => {
// Operation failed
})