getAllContactsFromServer method
- @Deprecated('Use fetchAllContactIds instead.')
从服务器获取联系人列表。
Return 联系人列表。
Throws 如果有方法调用的异常会在这里抛出,可以看到具体错误原因。请参见 ChatError。
Implementation
@Deprecated('Use fetchAllContactIds instead.')
///
/// 从服务器获取联系人列表。
///
/// **Return** 联系人列表。
///
/// **Throws** 如果有方法调用的异常会在这里抛出,可以看到具体错误原因。请参见 [ChatError]。
Future<List<String>> getAllContactsFromServer() async {
try {
Map result = await platform_interface.Client.instance.contactManager
.callNativeMethod(ChatMethodKeys.getAllContactsFromServer);
ChatError.hasErrorFromResult(result);
List<String> list = [];
result[ChatMethodKeys.getAllContactsFromServer]?.forEach((element) {
if (element is String) {
list.add(element);
}
});
return list;
} catch (e) {
rethrow;
}
}