logo
On this page

ZIM upgrade Guide


This article provides some instructions and considerations for upgrading the ZIM SDK for Web/Mini Program version.

2.18.0 upgrade guide

Warning

Starting from version 2.18.0, the following interfaces have undergone significant changes. Therefore, when upgrading from an older version to version 2.16.0, please read the following guidelines.

Callback on receiving one-to-one messages

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).
Untitled
// New callback
peerMessageReceived: (zim: ZIM, data: ZIMEventOfConversationMessageReceivedResult) => void;

// Old callback
receivePeerMessage: (zim: ZIM, data: ZIMEventOfReceiveConversationMessageResult) => void;
1
Copied!

Callback on receiving room messages

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.
Untitled
// New callback
roomMessageReceived: (zim: ZIM, data: ZIMEventOfConversationMessageReceivedResult) => void;

// Old callback
receiveRoomMessage: (zim: ZIM, data: ZIMEventOfReceiveConversationMessageResult) => void;
1
Copied!

Callback on receiving group messages

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.
Untitled
// New callback
groupMessageReceived: (zim: ZIM, data: ZIMEventOfConversationMessageReceivedResult) => void;


// Old callback
receiveGroupMessage: (zim: ZIM, data: ZIMEventOfReceiveConversationMessageResult) => void;
1
Copied!

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 version 2.16.0
Usage in old versions
// 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
    })
1
Copied!
// Regardless of whether userID is passed in userIDs, it is considered as canceling the entire call, can be called successfully when none of the callees in the call have accepted
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
    })
1
Copied!

Previous

ZPNs release notes

Next

Authentication