Multi-device read status sync
Sync remote channels
When logged in on multiple devices, call BaseChannel.syncRemoteChannels() to sync channel data across devices.
Method
Dart
static Future<int> syncRemoteChannels(ErrorHandler handler)
Code example
Dart
await BaseChannel.syncRemoteChannels((error) {
if (error == null) {
print('Remote channels synced');
}
});
Listen for channel sync
Register a ChannelHandler to receive notifications when remote channel data has been synced:
Dart
NCEngine.addChannelHandler('sync-handler', ChannelHandler(
onRemoteChannelSync: (code) {
print('Remote channel sync completed, code: $code');
},
));