Blue banner “Your app is using your location” is not showing after exiting my app

一曲冷凌霜 提交于 2019-12-12 11:26:04

问题


My application is using core location in background mode, when app is in background mode and sending GPS coordinates periodically, the blue banner "Your app is using your location" is not showing (like google map app for example). Any idea of what I could have missed ?


回答1:


To show blue bar, you should

1: Enable Background Location Updates in target Capabilities. Then set locationManager allowsBackgroundLocationUpdates to YES;

2: Add NSLocationWhenInUseUsageDescription in info.plist file (8.0+ ask for location). Then call requestWhenInUseAuthorization method not requestAlwaysAuthorization method.




回答2:


It only shows for applications registered for when in use location updates.



来源:https://stackoverflow.com/questions/31341043/blue-banner-your-app-is-using-your-location-is-not-showing-after-exiting-my-ap

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