iOS Question How to make it simple for user to pick "Always allow" when using geofences?

Sandman

Expert
Licensed User
Longtime User
I'm experimenting a bit with geofences on iOS (related thread) and have encountered something unexpected.

When starting the app, the OS asks me (something like):
"Do you want to allow this app to use positioning"

With these options for the user to select from:
  • Don't allow
  • Allow once
  • Allow while app is in foreground

However, as my app needs to react to the geofences while it is in the background, I need to pick the "allow always" option. That isn't available in the list above. To pick that option I need to manually go into the Settings app on the iPhone, find my app and in the Positioning settings there, I can find the "allow always" option.

So my question is, can I do something to make sure the "always allow" is in the initial list presented to the user?

If not, what strategies could I use? (I'm not very tempted to having to instruct the user to manually go into the settings etc - it's just bad user experience.)

I tried searching the forum about this but came up empty. I should also note that I do have a fully updated iPhone, and I do have this key in the code:
B4X:
#PlistExtra:<key>NSLocationAlwaysAndWhenInUseUsageDescription</key><string>Monitor some region.</string>
 

roumei

Active Member
Licensed User
I'm not sure about geofences but for normal GPS background location it is not possible to initially show the 'Always Allow' option. iOS grants this option automatically for a limited period of time if the user selects 'Allow While Using App' and shows an additional dialog with the 'Always Allow' option after the app has been used a couple of times.
A more detailed description of this behavior can be found here (see Allow While Using App section):
What you need to know about the new iOS 13: Location Permissions - Localytics (uplandsoftware.com)
 
Upvote 0

Sandman

Expert
Licensed User
Longtime User
That's interesting, but considering how many nuances there seem to be related to positioning and usage rights, I'm not sure this applies to geofences... :-/

Edit: I read the article again, and it does seem to apply to geofences. I also did some real-world tests, and as far as I can tell the article is correct. I haven't seen this yet, but I imagine I will do so at some point in the near future:
1614525134938.png
 
Last edited:
Upvote 0
Top