iPad remembering camera permissions after delete—how to clear?
You can't reset the permission programmatically. If you want to reset the permission there are two ways:
- Reset the OS
- Uninstall the app and wait for a day
I know both of those options are really not helpful for a developer, if they are trying to test it out something.
There are three alternatives for testing your app's first run scenario without resetting the entire OS or waiting a day.
First option
As described in Technical Note TN2265 :
You can achieve the latter without actually waiting a day by following these steps:
- Delete your app from the device.
- Turn the device off completely and turn it back on.
- Go to Settings > General > Date & Time and set the date ahead a day or more.
- Turn the device off completely again and turn it back on.
Second option
When you delete an app the iOS keeps the permission of your app mapped to your app's bundle id, it keeps the data for day. So you can also change your app's bundle id to test it out.
Third Option
As suggested by @rmaddy in the comment you can reset all location and privacy permissions : Settings -> General -> Reset -> Reset Location & Privacy.
Note that this will reset all location and privacy permissions for all the apps on that device.
IPhone remembers Location Permissions after uninstalling
This is the normal behavior since iOS 9 or 10. You can reset the permissions on the device's Settings -> General -> Reset -> Reset Location & Privacy.
Reset Permissions like Camera for iOS Apps?
Settings > General > Reset > Reset Location & Privacy.
This will reset all location, camera and microphone permissions.
It cannot be done on a per app basis.
PhotoLibrary access .notDetermined, when denying then enabling
I downloaded your code and ran it. I was able to experience whatever you said. It always returned Not Determined status.
I did a little bit analysis on your code further. Please find my observation below.
- In your current code, "PHPhotoLibrary.requestAuthorization" method is not called before reading the authorization status using "PHPhotoLibrary.authorizationStatus" method.
- Though "UIImageWriteToSavedPhotosAlbum" in Save method triggers a Photos app permission pop up, it does not help here completely.
- So, I called "askForAccessAgain" method in ViewDidLoad method in order to get the permission using "PHPhotoLibrary.requestAuthorization" method first.
- After that, whenever i saved the photos using Save method, it returned the correct status, let it be either "Authorized" or "Denied".
- If I choose "Never" and "Allow Photos Only", it returned "Denied or Restricted" status. When "Read and Write" is chosen, "authorized" is returned.
So, it looks like, We need to call "PHPhotoLibrary.requestAuthorization" method to get the permission first instead of relying on other Photo access methods ( like UIImageWriteToSavedPhotosAlbum) for getting the permission. Only then, correct status is returned by "PHPhotoLibrary.authorizationStatus".
One more addition info:
App Permissions are retained even after deleting the app and reinstalling it. Just take a look on this as well. It might help you in troubleshooting similar issues in future.
iPad remembering camera permissions after delete—how to clear?
Please let me know if this has resolved your issues.
Related Topics
"From View Controller" Disappears Using Uiviewcontrollercontexttransitioning
How to Crop Uiimage on Oval Shape or Circle Shape
Swiftui Navigationview Navigationbartitle Layoutconstraints Issue
Receiver (<Viewcontroller>) Has No Segue with Identifier 'Addsegue'
How to Convert My Device Token (Nsdata) into an Nsstring
iOS 11 Disable Password Autofill Accessory View Option
How to Add Subview Inside Uialertview for iOS 7
Uigraphicsgetimagefromcurrentimagecontext Memory Leak with Previews
Need Assistance Setting Two Buttons of Equal Width, Side by Side Autolayout
How to Define Optional Methods in Swift Protocol
Using Iskindofclass with Swift
Generate a Random Float Between 0 and 1
Round Top Corners of a Uibutton in Swift
Programmatically Creating an Expanding Uitableviewcell