unblockUser static method

Future<Map<String, dynamic>?> unblockUser(
  1. List<String>? uids, {
  2. required dynamic onSuccess(
    1. Map<String, dynamic> map
    )?,
  3. required dynamic onError(
    1. CometChatException excep
    )?,
})

Un-block a user from sending logged-in user any messages.

uids list of UID of users to be un-blocked

receive a map which contains UIDs as the keys and "success" or "fail" as the value based on if the un-block operation for the UID was successful or not

method could throw PlatformException with error codes specifying the cause

Implementation

static Future<Map<String, dynamic>?> unblockUser(List<String>? uids,
    {required Function(Map<String, dynamic> map)? onSuccess,
    required Function(CometChatException excep)? onError}) async {
  try {
    final result = await channel.invokeMethod('unblockUsers', {'uids': uids});
    final res = Map<String, dynamic>.from(result);
    if (onSuccess != null) onSuccess(res);
    return res;
  } on PlatformException catch (p) {
    _errorCallbackHandler(null, p, null, onError);
  } catch (e) {
    _errorCallbackHandler(null, null, e, onError);
  }
  return null;
}