iOS How do I reset Settings>Privacy so iOS will ask for my choice the next time?

Doctor Q

Administrator
Original poster
Staff member
Sep 19, 2002
37,549
3,625
Los Angeles
I'm using Xcode to run an app under development on a physical iPhone.

The first time I did this, iOS prompted me to allow or disallow camera access, since the app uses the camera. (The app has the appropriate Info.plist flags for this.)

I want to test what the app does if I agree and what the app does if I disagree, but I can't find a way to get the phone to forget the previous setting, even if I delete the app and try again. Instead, iOS remembers the previous answer instead of prompted again.

Example:
  1. I install and run the app, via Xcode.
  2. I get the iOS prompt for camera permission, which I answer one way or the other.
  3. I quit the app.
  4. I go to Settings > Privacy > Camera and there's the app's camera permission setting (either ON or OFF).
  5. I delete the app.
  6. In Settings > Privacy > Camera, the app is no longer listed.
  7. I install and run the app again, via Xcode.
  8. iOS doesn't prompt me for camera permission.
  9. I go to Settings > Privacy > Camera, and it shows that the previous setting (ON or OFF) has returned.
How do I get the phone to forget the previous camera privacy choice for this app?
 

Doctor Q

Administrator
Original poster
Staff member
Sep 19, 2002
37,549
3,625
Los Angeles
I found a way to do this:

After Step 6, power down the phone and restart it. The old privacy setting will be gone.

Annoying but effective.
 
Last edited:

Doctor Q

Administrator
Original poster
Staff member
Sep 19, 2002
37,549
3,625
Los Angeles
Does anyone know of a way to clear iOS's memory of a deleted app without restarting?

Some choice in Settings, perhaps? I haven't found it so far.
 

Doctor Q

Administrator
Original poster
Staff member
Sep 19, 2002
37,549
3,625
Los Angeles
Thanks. That's good news!

Does it mean that if an app determines that it does not have permission to use a protected resource, the app could offer to let the user enable it within the app, by using resetAuthorizationStatus( for: ) to clear the user's previous decision and then trying to access the resource? In other words, apps wouldn't have to refer users to the Settings app if the user wants to allow access where they previously disallowed it.
 

Doctor Q

Administrator
Original poster
Staff member
Sep 19, 2002
37,549
3,625
Los Angeles
I guess it wouldn't make sense to allow apps to remove a real user's authorization decision. A polite app would ask first, but a sneaky app might not.