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 {
  Map req = {'username': userId};
  Map result =
      await _channel.invokeMethod(ChatMethodKeys.acceptInvitation, req);
  try {
    ChatError.hasErrorFromResult(result);
  } on ChatError catch (e) {
    throw e;
  }
}