acceptInvitation method

Future<void> acceptInvitation(
  1. String userId
)

接受加好友的邀请。

Param userId 发起好友邀请的用户 ID。

Throws 如果有方法调用的异常会在这里抛出,可以看到具体错误原因。请参见 ChatError

Implementation

Future<void> acceptInvitation(String userId) async {
  try {
    Map req = {'userId': userId};
    Map result = await platform_interface.Client.instance.contactManager
        .callNativeMethod(ChatMethodKeys.acceptInvitation, req);
    ChatError.hasErrorFromResult(result);
  } catch (e) {
    rethrow;
  }
}