acceptInvitation method

Future<void> acceptInvitation(
  1. String userId
)

Accepts a friend invitation。

Param userId The user who sends the friend invitation.

Throws A description of the exception. See 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;
  }
}