upsertPresence method
void
upsertPresence({})
Create or upsert a presence entry for the current authenticated user over the existing realtime connection.
Requires an authenticated user and an open WebSocket connection (subscribe to a channel first if you don't have one yet).
Fire-and-forget: returns void and does not await the server response.
Mirrors the subscribe() shape — call without await. Throws synchronously
if there is no open WebSocket connection.
realtime.subscribe(['account']);
await Future.delayed(Duration(seconds: 1)); // let the WS open
realtime.upsertPresence(
status: 'online',
presenceId: 'p-1',
metadata: {'device': 'web'},
);
Implementation
@override
void upsertPresence({
required String status,
required String presenceId,
List<String>? permissions,
Map<String, dynamic>? metadata,
}) {
upsertPresenceTo(
status: status,
presenceId: presenceId,
permissions: permissions,
metadata: metadata,
);
}