setGlobalBadgeCounter method

  1. @override
Future<void> setGlobalBadgeCounter(
  1. int amount
)
override

Sets the global badge counter to the specified value. This value will be displayed on the app's icon badge (if supported by the device). If the amount is 0, the badge counter will be cleared.

ATTENTION: Developers should avoid mimicking increment and decrement functionality using this method and instead use incrementGlobalBadgeCounter and decrementGlobalBadgeCounter, which are optimized for performance.

Note that on some Android devices, such as those from Xiaomi or Samsung, the way badge counters are handled may be different from other devices and may not match the behavior on iOS devices. However, the Awesome Notifications plugin handles these differences automatically, so the developer should not need to worry about them.

Implementation

@override
Future<void> setGlobalBadgeCounter(int amount) {
  return AwesomeNotificationsPlatform.instance.setGlobalBadgeCounter(amount);
}