/ SDKs / Flutter
SDKs
Chat SDKs Flutter v3
Chat SDKs Flutter
Chat SDKs
Flutter
Version 3
Sendbird Chat SDK v3 for Flutter is no longer supported as a new version is released. Check out our latest Chat SDK v4

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 listQuery = ApplicationUserListQuery();
listQuery.userIds = ['Jeff'];

try {
    final users = await listQuery.loadNext();
    // user[0] is Jeff
    if (users.first.connectionStatus == UserConnectionStatus.online) {
        // Jeff is currently online.
        // UserConnectionStatus consists of online, offline, and nonAvailable.
    }
} catch (e) {
    // Handle error.
}