Request Authorization at Launch Time not triggering request authorisation popup

Since a recent upgrade - Xcode 9.4, WatchOS 4.3, iOS 11.4, the "Request Authorization at Launch Time" in my watchApp is no longer generating the request authorization pop-up on the phone.

My requests are appearing as if the user had provided authorization.

Yes, I have uninstalled the app and rebooted all devices many times to see if there was something left "hanging around".


In itself, that's not a problem, as I want my users to accept Notifications, they are intrinsic to my app, but the problem is that the Simulator is not requesting authorization and denying it in

center.requestAuthorization(options: [.alert, .sound]) { (granted, error) in
            print("granted: \(granted), error: \(error!)")
        }

}

Replies

What do you get exactly in the print ?


The problem may be with simulator : it stores the authorizations.

You can reset them:

h ttps://stackoverflow.com/questions/16195859/reset-ios-simulator-application-data-to-run-app-for-first-time

The print returns:

granted: false, error: nil

( I had to change the print to print("granted: \(granted), error: \(error)") )

And I followed the link to reset the Sim with the same result. The app starts with no request for authorization and does not generate Notifications.

When I run on the Device (Watch Series2, iPhone6) after uninstalling the app, the print returns

granted: true, error: nil

without prompting for authorization and generates Notifications correctly.

I remember that on earlier builds (earlier this month, I think) it would prompt for authoriztion, I don't precicely recall when it stopped prompting.


P.S. The link is now obsolete'ish as the Xcode Menu option is "Erase All Content and Settings...".