Chat / Flutter
Current version: v3
Chat Flutter v3
Chat Flutter
Chat
Flutter
Home
/
Chat
/
Flutter
/
User

Retrieve the online status of a user

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.
}