I've done quite a bit of searching online and can't seem to find a solid answer to this. This post https://stackoverflow.com/a/11649654/1211604 had a 2016 update stating that you can, but when I searched the Android docs for the areNotificationsEnabled() method it was no where to be seen. Can some one just confirm if doing this check against the OS is possible and if so the approach to do it?
Asked
Active
Viewed 1,326 times
0
-
Updates to the docs are always way behind, if they ever happen at all. Your best bet is to just get the latest version of the v4 support package, and see if the `NotificationManagerCompat` class has that method. – Mike M. Jun 15 '16 at 03:52
-
Thanks, I'm new to Android dev, what's the support package? – Stavros_S Jun 15 '16 at 03:55
-
Have a look at [this developer page](https://developer.android.com/topic/libraries/support-library/setup.html#download). – Mike M. Jun 15 '16 at 04:00
-
Will do, once installed I should be able to dig into the source of these packages and find the available methods? – Stavros_S Jun 15 '16 at 04:16
-
No source, but your IDE should list the available methods, somehow, be it through some sort of package/class explorer, or an autocomplete dropdown when you use it in code. – Mike M. Jun 15 '16 at 04:25
-
1@MikeM. It seems that in this case it's the opposite problem. The changelog shows that the `areNotificationsEnabled()` function has been added (https://developer.android.com/topic/libraries/support-library/revisions.html) but version 24.0.0 doesn't appear to be available in the Android SDK Manager. – yothsoggoth Jun 16 '16 at 13:08
-
So basically it does not yet exist? I'm confused. – Stavros_S Jun 16 '16 at 13:52
-
@Stavros_S: in latest files/docs I already see it, but the [documentation](https://developer.android.com/reference/android/app/NotificationManager.html#areNotificationsEnabled()) is quite lacking, I have little idea what `Returns whether notifications from the calling package are blocked.` exactly means. Also previously Google did state the ability to check notifications blocking was intentionally not added to API (have seen some details around it in some SO answer), so they did change their mind lately? Or is this call limited to some special cases? I hope they will extend the docs later. – Ped7g Jun 20 '16 at 13:06