getBlockListFromServer method

Future<List<EMContact>> getBlockListFromServer()

从服务器获取黑名单中的用户的ID

Implementation

Future<List<EMContact>> getBlockListFromServer() async {
  Map result =
      await _channel.invokeMethod(EMSDKMethod.getBlockListFromServer);
  EMError.hasErrorFromResult(result);
  List<EMContact> blockList = [];
  result[EMSDKMethod.getBlockListFromServer]?.forEach((element) {
    // 此处做了一个适配,目前native 返回的都是String, 为了避免以后出现进一步扩展,flutter直接返回contact对象
    blockList.add(EMContact.fromJson({'userId': element}));
  });
  return blockList;
}