acceptInvitation method
~english 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 ChatError. ~end
~chinese 接受入群邀请。
Param groupId
群组 ID。
Param inviter
邀请者的用户 ID。
Return 用户已接受邀请的群组对象。
Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 ChatError。 ~end
Implementation
Future<ChatGroup> acceptInvitation(
String groupId,
String inviter,
) async {
Map req = {'groupId': groupId, 'inviter': inviter};
Map result = await _channel.invokeMethod(
ChatMethodKeys.acceptInvitationFromGroup, req);
try {
ChatError.hasErrorFromResult(result);
return ChatGroup.fromJson(
result[ChatMethodKeys.acceptInvitationFromGroup]);
} on ChatError catch (e) {
throw e;
}
}