How can you request permissions for a photo gallery in iOS for the second time

In my iOS application, I access the user's photo gallery. The first time a user does this, he asks them for permission. Some of my users reported a crash for the first time due to a permission request, but on subsequent attempts it works fine.

To verify this myself, I need to remove the permission from my iPad and request it again. Is there a way to do this either through the iPad / iPhone or through code?

+2
source share
3 answers

Launch the Settings app. Go to the General section, then Reset. Click Reset Location and Privacy. This will reset all your location and privacy settings, not just for your test application. But you do it on the development device so that everything is in order. It also works in the simulator.

+2
source

In iOS 7+, you can go to Settings> Privacy> Photos and explicitly enable or disable access for individual applications.

This is much better than resetting your device’s privacy settings!

+2
source

Another way is to temporarily change the Bundle ID (CFBundleIdentifier) ​​in Info.plist. The system will consider such an application as a new separate application and display a warning “I would like to access your photos”. Remember to return CFBundleIdentifier after testing is complete.

0
source

All Articles