ios - CLLocationManager : any way to use requestAlwaysAuthorization and still have blue bar?

标签 ios background core-location

当我的应用程序在后台运行时,我真的很想看到显示“____ 正在使用您的位置”的蓝色条,因为这有利于用户体验。我只能在使用 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/

相关文章:

ios - 带有 Storyboard的通用应用程序上的 UISplitViewController

objective-c - 尝试添加核心位置时出现未知问题

iOS 核心位置 - 获取最准确的位置坐标

css - 多图网页正文背景

html - 正文和背景部分使用 CSS 分开

objective-c - 如何在 Core Data 中存储 CLPlacemark 地址数据

ios - 按下播放按钮时,YouTube IFrame 播放器显示 'This Video is Unavailable'

ios - UIView 的不透明度和 alpha 是否相同

ios - 如何保存拍摄的图像用作背景图像?

ios - Swift:在标签背景中制作图像