Skip to main content

Sync read status

Sync read status across devices

Sync the read status of a community subchannel to other logged-in devices by calling community.syncReadStatus().

Dart
final community = CommunityChannel('<community-id>');
await community.syncReadStatus(
SyncReadStatusParams(
subChannelId: '<subchannel-id>',
timestamp: lastReadMessageTimestamp,
),
(error) {
if (error == null) {
print('Read status synced');
}
},
);

Listen for read status sync

Dart
NCEngine.addChannelHandler('sync-handler', ChannelHandler(
onRemoteChannelSync: (code) {
print('Read status synced from another device, code: $code');
},
));