how is it that CLLocationManager gets a location when Airplane Mode is ON

本小妞迷上赌 提交于 2019-12-08 03:05:51

问题


My app uses CLLocationManager to get location updates from the device.

I had assumed that when the device was in Airplane Mode, I would not get location updates. But I do.

The reason I assumed this is because Apple says that Airplane mode turns off Wifi, Cellular, Bluetooth, and GPS. See: http://support.apple.com/kb/ht1355

So, how is it that I'm getting a location update with a coordinate that seems reasonable?


回答1:


I've developed an app that heavily uses the user location, so I had to check this and other situations.

I've learned that when all the services are off (Bluetooth, Wi-Fi, Cell Data) CLLocationManager returns the latest known location, so, in this case, even if the device in Airplane mode it will return a location.

You can try this by getting your location, turn Airplane mode on and then go far from there, ask the location again.

TL; DR: It doesn't. It returns the latest known location.




回答2:


You can manually turn WiFi back on in Airplane Mode, and possibly get a GPS fix if you wait long enough, depending on the iDevice model.



来源:https://stackoverflow.com/questions/7376294/how-is-it-that-cllocationmanager-gets-a-location-when-airplane-mode-is-on

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