fetchAllowListFromServer method
- String groupId
Gets the group allowlist from the server.
Param groupId The group ID.
Returns The group allowlist.
Throws Exception description, see ChatError.
Implementation
Future<List<String>> fetchAllowListFromServer(String groupId) async {
try {
Map req = {'groupId': groupId};
Map result = await platform_interface.Client.instance.groupManager
.callNativeMethod(ChatMethodKeys.getGroupWhiteListFromServer, req);
List<String> list = [];
ChatError.hasErrorFromResult(result);
result[ChatMethodKeys.getGroupWhiteListFromServer]?.forEach((element) {
if (element is String) {
list.add(element);
}
});
return list;
} catch (e) {
rethrow;
}
}