Android 4.1 offers the user a check box to disable notifications for a specific application.
However, as a developer we have no way to know whether a call to notify was effective or not.
I really need to check if the notifications are disabled for the current application but I can't find any setting for that in the API.
Is there ever a way to check this setting in the code?
Answer from @blundell is correct but there is a minor change in newer versions.
It seems like there is no way to query notification state.
I recommend this:
Not 100% correct. But this gives an opinion.
For example if user doesn't click any app notification for 10-15 days, probably he disabled it
Actually this is pretty easy to do:
If you are using Xamarin and you need this answer you can use this code:
You can't 100% can't.
It is asked in this Google I/O 2012 video and the Project lead for the new notifications declares that you can't.
Edit
2016 update: Now you can check it, as said in this Google I/O 2016 video.
Use
NotificationManagerCompat.areNotificationsEnabled()
, from support library, to check if notifications are blocked on API 19+. The versions below API 19 will return true (notifications are enabled).