getOnlineUserCount static method
Future<int?>
getOnlineUserCount({
- required dynamic onSuccess(
- int count
- required dynamic onError(
- CometChatException excep
get the total count of online users for your app
method could throw PlatformException with error codes specifying the cause
Implementation
static Future<int?> getOnlineUserCount(
{required Function(int count)? onSuccess,
required Function(CometChatException excep)? onError}) async {
try {
final result = await channel.invokeMethod('getOnlineUserCount', {});
if (onSuccess != null) onSuccess(result);
return result;
} on PlatformException catch (p) {
_errorCallbackHandler(null, p, null, onError);
} catch (e) {
_errorCallbackHandler(null, null, e, onError);
}
return null;
}