clear_notification_tray 0.0.3 copy "clear_notification_tray: ^0.0.3" to clipboard
clear_notification_tray: ^0.0.3 copied to clipboard

A plugin to clear notification tray in both android and iOS and reset the iOS badge count.

clear_notification_tray #

A Flutter plugin to dismiss notifications in Android and iOS.

How to use the plugin #

In the pubspec.yaml of your flutter project, add the following dependency:

    dependencies :
      clear_notification_tray: latest_version_number

The clear method can be called to clear all the notifications received by your app.
Upon receiving the push notifications, iOS applications display a red badge with notification count inside. It also dismisses this badge count.

To clear all notifications when the app is started, call the clear method in your main method.

void main() {
  runApp(MyApp());
  ClearNotificationTray.clear();
}

iOS compatibility #

This plugin is only compatible for clearing notifications in iOS devices running with iOS version 10.0 or above. The methods will return a PlatformException for iOS version less than 10.0 without dismissing notifications. The plugin uses UNUserNotificationCenter API to clear notification and reset the badge number on the app icon that was introduced in iOS version 10.0. Before iOS 10.0, there wasn't a standardized way to programmatically clear notifications or reset the badge number.

3
likes
150
points
195
downloads

Publisher

unverified uploader

Weekly Downloads

A plugin to clear notification tray in both android and iOS and reset the iOS badge count.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on clear_notification_tray