addBlack method

Future addBlack({
  1. required String userID,
  2. String? operationID,
  3. String? ex,
})

把对方添加到黑名单中

userID 被加入黑名单的好友ID

Implementation

Future<dynamic> addBlack({
  required String userID,
  String? operationID,
  String? ex,
}) async {
  ReceivePort receivePort = ReceivePort();
  OpenIMManager._sendPort.send(_PortModel(
    method: _PortMethod.addBlack,
    data: {
      'operationID': IMUtils.checkOperationID(operationID),
      'userID': userID,
      'ex': ex ?? '',
    },
    sendPort: receivePort.sendPort,
  ));
  _PortResult result = await receivePort.first;

  receivePort.close();
  if (result.error != null) {
    throw OpenIMError(result.errCode!, result.error!, methodName: result.callMethodName);
  }
}