getUsersByIMId method
Get information for the users specified by the list of the IM user ids. Maximum 50 users.
It's possible to get any users of the main Voximplant developer account or its child accounts.
users
- List of IM user ids
Throws VIException, if operation failed, otherwise returns List of VIUserEvent instances. For all possible errors see VIMessagingError
Implementation
Future<List<VIUserEvent>> getUsersByIMId(List<int> users) async {
try {
List<dynamic>? data = await _methodChannel
.invokeListMethod('Messaging.getUsersByIMId', {'users': users});
if (data == null) {
_VILog._e('VIMessenger: getUsersByIMId: data was null, skipping');
throw VIException(
VIMessagingError.ERROR_INTERNAL,
'VIMessenger:getUsersByIMId: data was null',
);
}
return data.map((e) => VIUserEvent._fromMap(e)).toList();
} on PlatformException catch (e) {
throw VIException(e.code, e.message);
}
}