requestToJoinPublicGroup method Null safety
Requests to join a group.
This method works only for public groups requiring authentication, i.e., groups with the style of {@link EMGroupStyle#PublicJoinNeedApproval}.
Param groupId
The group ID.
Param reason
The reason for requesting to join the group.
Throws A description of the exception. See {@link EMError}.
Implementation
Future<void> requestToJoinPublicGroup(
String groupId, [
String? reason,
]) async {
Map req = {'groupId': groupId};
req.setValueWithOutNull('reason', reason);
Map result = await _channel.invokeMethod(
ChatMethodKeys.requestToJoinPublicGroup, req);
try {
EMError.hasErrorFromResult(result);
} on EMError catch (e) {
throw e;
}
}