ping static method
Implementation
static Future<void> ping({required Function? onSuccess, required Function(CometChatException e)? onError}) async {
try {
await channel.invokeMethod('ping', null);
if(onSuccess != null) onSuccess();
} 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()));
}
}