notifications_enabled 0.0.2

Flutter Android iOS

A Flutter plugin that checks from native side if push notifications are enabled

notifications_enabled #

A Flutter plugin that checks from native side if push notifications are enabled.

Installation #

Declare a pubspec dependency in your Flutter project.

What is it for? #

It checks from native side if the app has permissions enabled/disabled for posting push notifications into user's device. In iOS it also provides information whether the permission was already requested.

How to use it? #

You can check the Example app to see a real use case on how to access the notifications enabled information. Shortly explained:

// Gets an optional checking if notifications are enabled for current app.
final Optional<bool> areNotificationsEnabled = await NotificationsEnabled.notificationsEnabled;

// Empty optional, means notification permissions were never requested
if (areNotificationsEnabled.isNotPresent) {
    // Possibly ask for permissions?
} else if (areNotificationsEnabled.value) {
    print('Notifications are enabled!');
} else {
    // Notiications are disabled
}
2
likes
80
pub points
71%
popularity

A Flutter plugin that checks from native side if push notifications are enabled

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

jonyas@gmail.com

License

BSD (LICENSE)

Dependencies

flutter, quiver

More

Packages that depend on notifications_enabled