unbanGroupMember static method
Future<String?>
unbanGroupMember({
- required String guid,
- required String uid,
- required dynamic onSuccess(
- String result
- required dynamic onError(
- CometChatException excep
Only Admin or Moderators of the group can unban a previously banned member from the group
guid
The UID of the group from which user is to be unbanned
uid
The UID of the user to be unbanned
method could throw PlatformException with error codes specifying the cause
Implementation
static Future<String?> unbanGroupMember({
required String guid,
required String uid,
required Function(String result)? onSuccess,
required Function(CometChatException excep)? onError}
) async {
try {
final result = await channel.invokeMethod('unbanGroupMember', {
'guid': guid,
'uid': uid,
});
if(onSuccess != null) onSuccess(result);
return result;
} on PlatformException catch (platformException) {
if(onError != null) onError(CometChatException(platformException.code, platformException.details, platformException.message));
} catch (e) {
debugPrint("Error: $e");
if(onError != null) onError(CometChatException(ErrorCode.errorUnhandledException, e.toString() , e.toString()));
}
return null;
}