There are several questions that come close to this, but I haven't found anything that's exactly right:
- Determine if local notification is allowed
- Check if Local Notifications allowed
- Check if Local Notifications are enabled in IOS 8
This does not related to remote notifications, I am only using local notifications.
I'd like to determine the current state of the local notifications permissions, so that I can show one of three interfaces:
- Notifications are enabled
- Notifications are not enabled, here's a button to enable them (which would trigger the standard dialog)
- Notifications have been denied (so the dialog cannot be displayed again), here's a link to Settings.app, so they can be enabled there.
It's easy to figure out if notifications are enabled with currentUserNotificationSettings()
, but I can't figure out how to determine between "not enabled because we haven't asked" and "not enabled because the user said no".