iOS location permission after app reinstall

你离开我真会死。 提交于 2019-12-08 20:36:05

问题


I’m using Crashlytics for internal application tests and noticed one interesting thing. I’m using geolocation in my app and asking for permissions from a user. When customer install app for first time he sees default Apple’s geolocation permissions asking pop up. And everything work fine. But, if user will remove app from phone and install it again... in this case, when I’m asking for permissions, pop up just won’t appear BUT geolocation is WORKING. How? Is this some sort of new feature or iOS issue? I were testing with iOS 11.0.3. I haven’t found anything in documentation, and haven’t seen this behavior in previous iOS versions. Looks like iOS just memorize the app and automatically enables geolocation when I’m asking for user permissions instead of showing pop up. Maybe someone has answer for this?


回答1:


it is possible that there could be a mistake in your code pattern while checking authorization status, the behavior you are seeing is likely due to iOS caching location permissions for apps.

In your code, make sure that you check authorization status (via the authorizationStatus() method), and continue with requesting location authorization when the current status is .notDetermined (kCLAuthorizationStatusNotDetermined)

iOS does cache authorization status for apps as well. If you would like to reset your location permissions for testing purposes, you can set your location privacy settings to the factory default: go to Settings > General > Reset and tap Reset Location & Privacy. When your location and privacy settings are reset, apps will stop using your location until you grant them permission.

Unfortunately there is no developer control over this. Caching of permissions for apps is in an ever evolving stage, where we are trying to find the best user experience, so you may have noticed some changes lately. Also, there will be a grace period where the app uninstall to reinstall time might be making a difference.

If your observations of apps that behave like you expected are recent (on the same version of iOS that you have observed your app behave differently), and the uninstall/reinstall time difference is immediate (like how you probably test your app), please let me know which apps, and I will see if I can dig some information.



来源:https://stackoverflow.com/questions/46941787/ios-location-permission-after-app-reinstall

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