当我的应用程序在后台运行时,我真的很想看到显示“____ 正在使用您的位置”的蓝色条,因为这有利于用户体验。我只能在使用 requestWhenInUseAuthorization
并在 plist 中将 Location 作为背景模式时显示此栏。
我遇到过需要使用 requestAlwaysAuthorization
的情况,否则当应用程序已经在后台时我无法开始位置更新:CLLocationManager startUpdatingLocation() doesn't work when called in background
但是我不能使用requestAlwaysAuthorization
,因为那样做会导致蓝条不显示,而且对我(和用户)来说蓝条更重要。有没有办法同时使用 requestAlwaysAuthorization
并显示蓝色条?
最佳答案
没有。您所说的一切都是完全准确的:您只获得一种授权,如果是始终授权,则没有蓝条。 (相反,每隔几天就会要求用户重新确认 Always 授权。)
在 Core Location 观看 WWDC 2015;这点很清楚。
如果您认为自己有相反的用例,请向 Apple 提交增强请求。
关于ios - CLLocationManager : any way to use requestAlwaysAuthorization and still have blue bar?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35487019/