此应用程序如何立即请求后台位置许可? [英] How does this app ask for background location permission immediately?

查看:66
本文介绍了此应用程序如何立即请求后台位置许可?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从iOS 13开始,我的理解是背景定位权限只能由用户 授予,前提是用户已经授予前台位置权限,并且应用在后台运行,而发生位置事件时,触发了应用的后台位置发生.到那时,他们会看到类似以下的对话框:

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?

推荐答案

如果您的应用已请求并收到使用中"信息,然后,它可以请求总是"授权.授权触发第二个权限对话框.此行为需要iOS 13.4或更高版本.

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

这篇关于此应用程序如何立即请求后台位置许可?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆