getLoggedInDevicesFromServer method
- @Deprecated('Use [fetchLoggedInDevices] instead')
Gets the list of currently logged-in devices of a specified account.
Param userId
The user ID.
Param password
The password.
Return The list of the logged-in devices.
Throws A description of the exception. See ChatError.
Implementation
@Deprecated('Use [fetchLoggedInDevices] instead')
///
/// Gets the list of currently logged-in devices of a specified account.
///
/// Param [userId] The user ID.
///
/// Param [password] The password.
///
/// **Return** The list of the logged-in devices.
///
/// **Throws** A description of the exception. See [ChatError].
///
///
///
Future<List<ChatDeviceInfo>> getLoggedInDevicesFromServer(
{required String userId, required String password}) async {
Map req = {'username': userId, 'password': password};
Map result = await ClientChannel.invokeMethod(
ChatMethodKeys.getLoggedInDevicesFromServer, req);
try {
ChatError.hasErrorFromResult(result);
List<ChatDeviceInfo> list = [];
result[ChatMethodKeys.getLoggedInDevicesFromServer]?.forEach((info) {
list.add(ChatDeviceInfo.fromJson(info));
});
return list;
} on ChatError catch (e) {
throw e;
}
}