fetchPresenceStatus method
Gets the current presence state of users.
Param members
The array of IDs of users whose current presence state you want to check.
Return Which contains the users whose presence state you have subscribed to.
Throws A description of the exception. See ChatError.
Implementation
Future<List<ChatPresence>> fetchPresenceStatus({
required List<String> members,
}) async {
Map req = {'members': members};
Map result =
await _channel.invokeMethod(ChatMethodKeys.fetchPresenceStatus, req);
try {
ChatError.hasErrorFromResult(result);
List<ChatPresence> list = [];
result[ChatMethodKeys.fetchPresenceStatus]?.forEach((element) {
list.add(ChatPresence.fromJson(element));
});
return list;
} on ChatError catch (e) {
throw e;
}
}