StackOverFlow  顶部蓝条

I'd really like to have the blue bar that says "____ is Using Your Location" when my app is in the background, because it's good for the user experience. I can only get this bar to show up when I use requestWhenInUseAuthorization
, along with having Location as a Background Mode in the plist.
I've come across a scenario where I need to use requestAlwaysAuthorization
instead, since otherwise I can't start location updates when the app is already in the background: CLLocationManager startUpdatingLocation() doesn't work when called in background
But I cannot use requestAlwaysAuthorization
, because doing that will cause the blue bar to not show up, and it's more important for me (and the users) to have the blue bar. Is there any way to simultaneously use requestAlwaysAuthorization
and have the blue bar show up?

˚˚˚

No. Everything you've said is completely accurate: you only get one kind of authorization, and if it's Always authorization, there's no blue bar. (Instead, the user will be asked every few days to reconfirm the Always authorization.)

Watch the WWDC 2015 on Core Location; it's very clear about this.

If you think you have a contrary use case, file an enhancement request with Apple.



http://stackoverflow.com/questions/35487019/cllocationmanager-any-way-to-use-requestalwaysauthorization-and-still-have-blue

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容