Multi-Device Message Synchronization
Multi-Device Message Synchronization
In instant messaging services, a single user account may be logged in on multiple devices. Multi-Device Message Synchronization is a service provided by RC's server, which allows for the synchronization of sent and received messages 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 instant messaging services, Multi-Device Message Synchronization is applicable in the following scenarios:
- The same user account is simultaneously online on multiple devices (regardless of whether they are the same type of device), and the user wishes to synchronize sent and received messages. For example, a user may own multiple mobile devices, such as two Android devices and one iOS device.
RC by default supports simultaneous online presence across multiple platforms. 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 simultaneously online on multiple mobile devices or multiple mini-program clients, please refer to Multi-Platform Online.
- The same user account logs in on a different device (regardless of whether they have logged in on that device before), and the user wishes to synchronize sent and received message history. For example, a user logs off from an Android device and then logs in from a web client on another device.
- The same user account reinstalls the app on the current device, and the user wishes to synchronize sent and received message history.
Messages Supported for Synchronization Across Multiple Devices
Not all messages support multi-device message synchronization. Status messages can only be synchronized across devices that are simultaneously online. Devices that are offline cannot receive these 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, please refer to the "Custom Messages" documentation for each client.
- All messages sent using the server API status message interface (regardless of message type) do not support synchronization. The specific API interfaces include sending one-to-one chat status messages (
/statusmessage/private/publish.json
) and sending group chat status messages (/message/group/publish.json
).
Enabling the Service
Please go to the Console and enable the Multi-Device Message Synchronization service under the General Services tab on the Chat pricing plans page. This service is free to use in the development environment and is disabled by default. In the production environment, the service can only be enabled after prepayment.
Changes to the service's enable/disable status take effect within 30 minutes.
Impact on Other Features or Services
The status of the Multi-Device Message Synchronization service affects the offline compensation?, message recall, and chatroom services in instant messaging.
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:
- Logging in on a different device. 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 a 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 user uninstalls the app. 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 a specified number of recent days (default is 1 calendar day).
In the scenarios of logging in on a different device or app reinstallation, the offline compensation mechanism can only retrieve conversations from the most recent days (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 like some conversations are missing).
To modify the number of days for offline message compensation, please submit a ticket. It is recommended to set the offline compensation days cautiously, as a large volume of messages for a single user may result in significant processing pressure on the client.
Impact on Web Platform Connection Count
After enabling the Multi-Device Message Synchronization service, additional web page connections are supported (each browser tab is considered a separate connection), up to a maximum of 10.
Impact on Message Recall
- When the Multi-Device Message Synchronization service is not enabled, recalled messages cannot be synchronized across multiple devices.
- After enabling the Multi-Device Message Synchronization service, once a message is recalled by the sender, 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 once the user logs in.
Impact on Server API Message Sending
When sending messages via the server API, some interfaces allow the sender to specify whether the message can be received by the client through 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 if the sender is logged in (online). They cannot be synchronized to offline clients.
- 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 once they log in again.