How does this app ask for background location permission immediately?

↘锁芯ラ 提交于 2021-01-28 06:12:52

问题


My understanding since iOS 13 is that background location permissions can only be granted by the user after they have already granted foreground location permissions, and the app is in the background, when a location event which would have triggered the app's background location occurs. At that point they get a dialog something like:

Allow “App” to also access your location even when you are not using the app?

Every app I've used has the same behaviour, except one app, which is able to present that dialog immediately after asking for the foreground location permission dialog:

How does this app immediately and repeatedly trigger the background location dialog like this?


回答1:


If your app has asked for and received "when in use" authorisation it can then ask for "always" authorisation to trigger a second permission dialog. This behaviour requires iOS 13.4 or later.

You should consider the user experience. I suggest that your app explains why it needs always authorisation before asking for it, otherwise the user may be peppered with permission requests



来源:https://stackoverflow.com/questions/64534309/how-does-this-app-ask-for-background-location-permission-immediately

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!