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

梦想的初衷 提交于 2019-12-06 11:16:08

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.

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.

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