iPad remembering camera permissions after delete—how to clear? - ios

I'm trying to recreate the condition where the following code returns AVAuthorizationStatusNotDetermined:
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
However, the iPad appears to remember camera permissions even after the app is deleted and reinstalled, and so either Authorized or NotAuthorized is returned every time. Any idea how to reset the permissions so that NotDetermined is returned?
Thanks for reading.

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.

This is no longer an issue if you update OS version on your device to the latest. It didnt work on 13.3.1 but it did clear permissions after 13.4.1

On iOS 14 go to Settings->Privacy->Location Services, select the app and for allow location access pick "Ask Next Time"

What worked for me:
Windows -> Devices And Simulators -> Installed Apps section
Remove the app from there using the - button.

Related

iOS13 automagically remembers app permissions after deleting app [duplicate]

I'm trying to recreate the condition where the following code returns AVAuthorizationStatusNotDetermined:
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
However, the iPad appears to remember camera permissions even after the app is deleted and reinstalled, and so either Authorized or NotAuthorized is returned every time. Any idea how to reset the permissions so that NotDetermined is returned?
Thanks for reading.
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.
This is no longer an issue if you update OS version on your device to the latest. It didnt work on 13.3.1 but it did clear permissions after 13.4.1
On iOS 14 go to Settings->Privacy->Location Services, select the app and for allow location access pick "Ask Next Time"
What worked for me:
Windows -> Devices And Simulators -> Installed Apps section
Remove the app from there using the - button.

Access is not requested again after reinstalling the app in iOS12

After updating to iOS12 and testing the apps build in Xcode 9, we found out that after deleting and reinstalling the app - the user is not prompt again with a question regarding access to the Camera or Gallery.
On iOS11, every time the app is installed, iOS asks for permission.
I tested few random apps from AppStore to see how they behave and the conclution is - some of them do reset the access and some don't. So, I'm completely lost.
Also, as an info, but I'm not 100% sure about this: when there is a time period between deleting and installing the app (more than 1h), even on iOS 12 is asking for permission.
Is there any change there in iOS 12? Do you have any clue how to keep iOS 11 behaviour instead?
Thanks!
The only certain way to test the authorization request process again after deleting your app is (and always has been) to go to the Settings app and choose General -> Reset -> Reset Location & Privacy. This is a major pain because you've now reset all your location and privacy settings.
My other suggestion (and it's only a suggestion) is that you try restarting the device after deletion of the app. Maybe, just maybe, this will cause the device to write something out to disk that will cause it to forget about its previous authorization of this app.

How to get user permissions every time in iOS 9

I am doing application related to camera,photos and GPS.Whenever i open the app i need to ask the permissions to user on every installation.This is working fine in iOS 10.But in iOS 9,if i uninstall and install again,permission popups are not coming,but in iOS 10 it's working correctly.Please suggest how to get the popups every installation in iOS 9 also.
This issue will appear if in your "info.plist" file contains "CFBundleDisplayName" with empty string value. Just enter your app name there. Also if that is not working try to reset the settings by below 3 way,
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
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.
With iOS 9 it will take around 2 days to remove the permission from OS. Within 2 days if you install that app again which you installed previously and accepted permissions previously then it will not ask for the permission again. If the install is after 2 days then it will ask for permission.
If you want it to give a try then you can check it after increasing the date with 2-3 days then install application. Then it will definitely ask for the permission.

Show permissions dialog again in iOS

I'm working on an iOs app written in Swift with a Camera view controller. The first time I launched this view controller, the permission dialog was shown and I allowed the access to the camera and to the photo library. However, I noticed an issue while allowing the library permission and I would like to be able to reproduce it in order to fix it... But to do that, I need to re-show this permission dialog. However, even if I delete the app and reinstall it, I never get this permission dialog again.
How to get it again so I can fix my issue?
There is no perfect solution
The recommended way is go to "Settings" app
(General > Reset > Reset Location & Privacy).
But as you say, it resets all the apps.
Another option is to change the bundle identifier of the app, so it's considered a new app and it will ask again.
The third option is to delete the app, change your device time for more than 24 hours forward, turn the device off and turn it on again.
I'm not certain that it works in iOS 9, but in iOS 8 the system expired the privacy settings once the application had been uninstalled for 24 hours. You could simulate it by removing the application, moving time ahead a day in Settings and then reinstalling the application.
There's also Reset Location & Privacy, but that's a global reset.
You can go in Settings -> Privacy -> Camera and disable your app.
If you're jailbroken, you can run these shell commands on the device to reset all the permissions dialogs for just your app:
export bundleIdentifier="com.yourcompany.product"
sqlite3 /private/var/mobile/Library/TCC/TCC.db "DELETE FROM access WHERE client = '${bundleIdentifier}'"

How to call permission sheet again CoreMotion

I have been using some CoreMotion (pedometer) data in an app that I am writing. Early on I granted the app permission to the data and everything is working well.
Now I am going to write the part that asks the user for permission but since I have already granted the permissions the dialog never comes up and I can not test the behavior except on a new phone every time (not feasible).
Is there a way to delete from iOS all knowledge of the app so it looks like a first time install again?
If you just want to reset permission to access Motion data, you could tap "Reset Location & Privacy" in Settings > General > Reset.
Delete the app from the device and install it again.
Or go to settings, find you app in the list and uncheck switch representing motion data.
Deleting app may not be enough. Try this:
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.
Combining all answers, from soft to radical:
Uncheck the permission in Settings. That works for motion, location, healthkit, etc.
Delete the App. This is generally enough for all case scenario
Simulator: Reset Contents and Settings...
You can do that from command line, too.
Device: Settings > General > Reset > Erase All Content and Settings
That is what a development device is for.

Resources