Local Notification

Hi,
how can I check if someone has allowed local notifications?

Thanks in advance!
Try
Code Block
UNUserNotificationCenter.current().getNotificationSettings { (settings) in
if settings.authorizationStatus == .authorized {
// Notifications are allowed
}
else {
// Either denied or notDetermined
}
}

As defined here here:
https://stackoverflow.com/questions/46664177/check-whether-user-notifications-are-enabled-after-uilocalnotification-deprecati
Just tried this, it didn’t work. Other ideas?

Just tried this, it didn’t work. Other ideas?

No other idea if you don't give other information.
Could you explain precisely what you get, what you expect, conditions of test…
And please, show the complete code where you tried it.
Or is it the same code than the other thread ?
https://developer.apple.com/forums/thread/671702

Don't forget to close the threads when you're done or explain what is still not working as expected.
That didn't work to check, nothing happened with the switch. Same code as the other thread.
Local Notification
 
 
Q