Repeat UNUserNotificationCenter.requestAuthorization(options:, completionHandler:)

Hi,


I use UNUserNotificationCenter for communication bewteen a Network Extension and the container app. As long as the user must grant a permission to use notification I call UNUserNotificationCenter.requestAuthorization(options:, completionHandler:) method before proceeding.


If the user doesn't allow notifications the communication is obviously disabled. And any subsequent requestAuthozation calls doesn't show the same UI prompt. My question is whether there is a way to show the same permission request UI after the user has denied it once.


I know that you could check permissions and display a custom UIAlertController asking the user to enable notifications manually. But I am interested in showing the very same UI the user sees the first time. This would be useful in Network Extension for example where you cannot show any custom UI.


Thanks,
Dmitry

Replies

My question is whether there is a way to show the same permission request UI after the user has denied it once.

No.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"