Is it me? Or is there a fundamental flaw in Apples approach to requesting location always permission.
What am I missing?
Background: It’s a geofencing app.
-
UI has previously requested wheninuse permission. We won’t ask for ‘always’ until the user has allowed location when in use.
-
UI offers the user to select to have the app run location in background in order for our geofencing use case to work
-
Prompt appears with “Keep Only While Using” / “Change to Always Allow”. User accidentally selects “Keep while using”
-
The async call to “locationManager.requestAlwaysAuthorization()” never replies to any delegate method at all, especially not didChangeAuthorization. Not even with a “user denied”
From Apple:
Keep Only While Using: Core Location leaves the authorization as When In Use. The delegate doesn’t receive any updates.
So essentially it does nothing, but doesn’t tell you.
To be clear, we have all the correct settings in pinfo and using a a strong reference to the CLLocationManager. The process works fine if the user doesn’t make a mistake/change mind.
Does that not break a form of design rule. Ie, if you’re forcing an async call, you should always provide a response, so developer can deal with it.
The net effect for our UI currently, is that our little loading icon sits there until it timesout and nothing is said to the user. They don’t even know that they made a mistake.
And worse still, we can never correct this position from within the app:
From apple:
Core Location limits calls to requestAlwaysAuthorization(). After your app calls this method, further calls have no effect. If a compatible iPad or iPhone app calls this method when running in visionOS, the method treats it as a request for When in Use authorization instead.
How are others dealing with this scenario?
I would expect something back from the async to locationManager.requestAlwaysAuthorization() when the user interacts.
I would also expect a way to correct this scenario without directing the user to the settings section to have to manually dig out things. Our target users for this app aren’t necessarily tech savvy. But the main issue is that I would expect a way of determining what state we’re in!?