Open vadimue opened 6 years ago
@sunshinejr Hi, I guess maybe you can know about this flow? Why we need return UserDefaults.standard.requestedLocationAlwaysWithWhenInUse ? .denied : .notDetermined
in case of authorizedWhenInUse
status, and don't return simply .denied
? I think it can resolve my problem.
I am developing an app, which uses location always. So I request Location permission with status "Always" on
viewDidLoad()
of WelcomeViewController. Steps of this flow:The problem is user don't see notification second time. I read a source code and find out the line of cause such behavior: On second time
UserDefaults.standard.requestedLocationAlwaysWithWhenInUse
still false, so we have wrong status of location permission that's why app requests permission again instead of showing denied alert. And in this second requestingUserDefaults.standard.requestedLocationAlwaysWithWhenInUse
became true, so on third time we have correct status.Frankly, I don't know how to fix this problem by the clean way, can you have any suggestion?