What determines the presence of the iPhone Location Services icon in the status bar?

大兔子大兔子 提交于 2019-11-28 00:45:09

Here's an update and a solution I've come to after some fiddling. Since my problem was clearly an issue with the OS making some connection between my app's ID and the Location Services icon, I tried resetting the device's location warnings, which I did not originally know I could do. For the curious, this can be accomplished through the Settings app, then General > Reset > Reset Location Warnings. After making this reset and upon reinstalling the app, it again requested to use Location Services. Now, the icon appears precisely on startUpdatingLocation and disappears precisely on stopUpdatingLocation, exactly as I originally intended.

I have no idea what initially caused this condition, and I have little doubt that the condition itself is an OS bug, as indicated by Matthew Frederick, but, at least in my case, the condition is curable.

There's a known bug that's causing this problem. I reported it to Apple a couple of months ago and was informed that it was a dupe of a known problem. Unfortunately it doesn't appear to have been fixed.

I first discovered it when I saw the symbol appear (and my app showing as having permission to use location info in the Settings app) simply by installing my app on a device that no longer had the app installed, not having even run it.

For whatever reason the device keeps a reference to the app having once received permission for location services.

Worse, if the app actually received permission in the past, then gets uninstalled, then an updated version of the app is installed, not only does the icon appear but the upgraded app no longer actually receives location information because the app never gets to ask the OS for location permission. It's effectively permanently denied.

Very frustrating for me and a small number of my users.

You haven't enabled the location option in the UIBackgroundModes key of your app's .plist, have you?

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