getBadgeCount method

  1. @override
Future<int?> getBadgeCount()
override

Gets the current badge count from the app icon.

Returns 0 if the platform is not Android or iOS, or if badge count is not supported.

Implementation

@override
Future<int?> getBadgeCount() async {
  if (!Platform.isAndroid && !Platform.isIOS) return 0;
  final result = await methodChannel.invokeMethod<int>('getBadgeCount');
  return result;
}