Reputation: 1697
What is the difference between the areNotificationsEnabled and areNotificationsPaused methods in the NotificationManager class?
Upvotes: 1
Views: 1302
Reputation: 3586
areNotificationsEnabled
The first method, i.e areNotificationsEnabled will be able to tell if the notifications we completely blocked by the user for your app or the package name you want The user can block the notification in this way
areNotificationsPaused
The second method will be able to tell if the app was snoozed or paused in other terms, that is, a temporary stoppage of notifications from a certain app The user can snooze notifications from the notification panel by sliding left or right partially and then set the time for which they want the notification to be snoozed
Upvotes: 4
Reputation: 579
I would like to suggest you to go through the official docs for the same, it will help you alot, bi
areNotificationEnabled:- https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat
public boolean areNotificationsEnabled()
Returns whether notifications from the calling package are not blocked.
areNotificationPaused:- https://developer.android.com/reference/android/app/NotificationManager
public boolean areNotificationsPaused()
Returns whether notifications from this package are temporarily hidden. This could be done because the package was marked as distracting to the user via PackageManager#setDistractingPackageRestrictions(String[], int)
or because the package is PackageManager#setPackagesSuspended(String[], boolean, PersistableBundle, PersistableBundle, SuspendDialogInfo)
suspended.
Upvotes: 1