Skip to main content

Multi-Device Message Synchronization

In the Instant Messaging (IM) business, a single user account may be logged in on multiple devices. Multi-Device Message Synchronization is a service provided by RC's server to synchronize message sending and receiving across multiple devices under the same user account.

By default, RC does not synchronize messages between devices. Once a new message is received by one device, other devices cannot receive the same message.

Applicable Scenarios

In RC's IM business, Multi-Device Message Synchronization is applicable in the following scenarios:

  • A single user account is simultaneously online on multiple devices (regardless of whether they are the same platform), and the user wishes to synchronize message sending and receiving. For example, a user may own multiple mobile devices, such as two Android devices and one iOS device.

    tip

    RC supports simultaneous online access across multiple platforms by default. A single user account can be simultaneously online on one mobile device, one web client, one desktop client, and one mini-program client. However, if you need to allow app users to be online on multiple mobile devices or multiple mini-program clients simultaneously, you must submit a ticket for each case. For more details, see Multi-End Simultaneous Online.

  • A single user account switches to a different device (regardless of whether the user has logged in on that device before) and wishes to synchronize the message history. For example, a user logs out from an Android device and logs in from a web client on another device.

  • A single user account reinstalls the app on the current device and wishes to synchronize the message history.

Messages Supported for Synchronization Across Devices

Not all messages support Multi-Device Message Synchronization. Status messages can only be synchronized across devices when they are simultaneously online. Offline devices cannot receive status messages through Multi-Device Message Synchronization.

The following scenarios are considered status messages:

  • Messages defined as status messages in RC's built-in message types. Built-in status messages include: typing status messages (RC:TypSts).
  • Custom status message types. For details, refer to the "Custom Message" documentation for each client.
  • All messages sent via the server API status message interface (regardless of message type) do not support synchronization. The specific API interfaces are: sending private status messages (/statusmessage/private/publish.json) and sending group status messages (/message/group/publish.json).

Enabling the Service

Go to the Console and enable the Multi-Device Message Synchronization service under the Basic Services tab on the Chat pricing plans page. This service is free to use in the development environment and is disabled by default. For the production environment, you must prepay to enable the service.

The service takes effect within 30 minutes after enabling or disabling it.

(width=500)

Impact on Other Features or Services

The status of the Multi-Device Message Synchronization service affects offline compensation?, message recall, chatroom services, and other aspects of the IM business.

Impact on Offline Compensation

The Multi-Device Message Synchronization service in the Console includes the switch for RC's server-side offline compensation mechanism?.

After enabling the Multi-Device Message Synchronization service, RC's server automatically enables the offline compensation mechanism for the app. The offline compensation mechanism is triggered in the following scenarios:

  • Switching Devices. After a user logs in on a new device (regardless of whether they have logged in on that device before), the SDK can retrieve messages sent and received on other terminals within the specified number of recent days (default is 1 calendar day).

  • App Reinstallation. Messages and conversation lists are stored in the local database, which is deleted when the app is uninstalled. After the user reinstalls the app and reconnects, RC's server-side offline compensation mechanism is triggered, and the SDK can retrieve messages sent and received on other terminals within the specified number of recent days (default is 1 calendar day).

    tip

    In the Switching Devices or App Reinstallation scenarios, the offline compensation mechanism can only retrieve conversations from the most recent period (default is 1 day, maximum is 7 days). Conversations older than this period cannot be retrieved through the offline compensation mechanism. Therefore, the conversation list after offline compensation may not match the list on the original device or before uninstallation (you may feel as if some conversations are missing).

To modify the number of days for offline message compensation, submit a ticket. It is recommended to set the offline compensation period cautiously, as an excessive number of messages for a single user may cause significant processing pressure on the client.

Impact on Web Platform Connection Count

After enabling the Multi-Device Message Synchronization service, a single user can support up to 10 web client connections (each browser tab is considered a separate connection). Connections beyond 10 will automatically disconnect the earliest web client connection.

Impact on Message Recall

  • When the Multi-Device Message Synchronization service is not enabled, message recalls cannot be synchronized across multiple devices.
  • After enabling the Multi-Device Message Synchronization service, once the sender recalls a message, if the user is online on other devices, the message will be synchronized and recalled on those devices. If the user is offline on other devices, the message will be synchronized and recalled after the user logs in.

Impact on Server API Message Sending

When sending messages via the server API, some interfaces allow you to specify whether the sender can receive the sent message on the client by using the isIncludeSender parameter.

  • When the Multi-Device Message Synchronization service is not enabled, messages sent via the server API can only be synchronized to the sender's online client in real-time if the sender is logged in. Offline clients cannot receive the message.
  • After enabling the Multi-Device Message Synchronization service, if the sender is not logged in (offline), messages sent via the server API can be synchronized to the sender's online client after they log in again.