简体   繁体   中英

iOS location permission after app reinstall

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM