How to avoid show the location usage prompt while app in background?

My app needs monitors the iBeacon, so it needs always access the location service.
But it always show this prompt to let user change the setting to 'while using'. It's confuse for users, and I also not call the location service at background.
How to avoid show this prompt? Which API call trigger this prompt?
Answered by Brain_008 in 663559022
I only fetch the monitoredRegions and register new region if needed in background, maybe I could try to avoid call CLLocationManager in background.
Note: this workaround only applies to iOS 13.4 and later

Every app gets only one chance to ask for Always. It can use it directly as the first ask, in which case the app will wind up in Provisional Always auth mode, and get the deferred prompt eventually, which is what you are complaining about. This prompt will always arrive when there are no apps running in the foreground.

Apps can also ask for when-in-use first. And then ask to upgrade to Always, once the user is familiar with the app more, and have a lower chance of being rejected at the prompt.

On iOS 13.4 and later: the user will see a prompt for upgrading from when-in-use to Always immediately, over the app which is asking for the authorization.

Asking for when-in-use first, and only ask to upgrade to Always (if it turns out you need it) is the preferred way of doing this.

In 13.4 this strategy now has the added benefit of eliminating the Provisional Always period while the app waits for the system to prompt the user sometime in the future. The benefit for those apps will be that once the user agrees to Always at that point, the app will have full Always authorization.

Of course, you should be careful in using this technique, as asking for this two step permission back to back will create a jarring experience for the user, and may end up them eventually rejecting your request.

All this, though, still does not change the fact that the users will be reminded periodically in the future that your app has been using their location in the background. Those prompts will always arrive outside of your app, and there is no way to stop them from appearing.


Thank you for your help.
And the number of the times to used location I think it's must be related to the CLLocationManager, do your know which method call will count the number, or just call the CLLocationManager it will count the number?
Every time CoreLocation delivers your app location data, it will count as a case.
Accepted Answer
I only fetch the monitoredRegions and register new region if needed in background, maybe I could try to avoid call CLLocationManager in background.

After several test, I found if call the method or property of CLLocationManager, it will show the blue arrow on the task bar. Not matter which property or method.

How to avoid show the location usage prompt while app in background?
 
 
Q