/ SDKs / Flutter
SDKs
Chat SDKs Flutter v4
Chat SDKs Flutter
Chat SDKs
Flutter
Version 4

Retrieve the online status of a user

Copy link

You can check if a user in the Sendbird application is currently connected to the Sendbird server. For group channels only, you can check whether each member is currently connected to the server.

final query = ApplicationUserListQuery()
  ..userIdsFilter = ['Tyler'];

try {
  final users = await query.next();

  // user[0] is Tyler.
  if (users.first.connectionStatus == UserConnectionStatus.online) {
    // Tyler is currently online.
    // UserConnectionStatus consists of online, offline, and notAvailable.
  }
} catch (e) {
  // Handle error.
}