acceptInvitation method Null safety
Accepts a group invitation.
Param groupId
The group ID.
Param inviter
The user who initiates the invitation.
Return The group instance which the user has accepted the invitation to join.
Throws A description of the exception. See {@link EMError}.
Implementation
Future<EMGroup> acceptInvitation(
String groupId,
String inviter,
) async {
Map req = {'groupId': groupId, 'inviter': inviter};
Map result = await _channel.invokeMethod(
ChatMethodKeys.acceptInvitationFromGroup, req);
try {
EMError.hasErrorFromResult(result);
return EMGroup.fromJson(result[ChatMethodKeys.acceptInvitationFromGroup]);
} on EMError catch (e) {
throw e;
}
}