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

前端 未结 3 496
后悔当初
后悔当初 2020-12-11 08:31

In my iOS app I am accessing the user\'s photo gallery. The first time the user does this, it asks them for permission. Some of my users have reported getting a crash this

相关标签:
3条回答
  • 2020-12-11 09:13

    Another way is to temporary change Bundle Identifier (CFBundleIdentifier) in Info.plist. System will treat such app as a new separate app and will display "would like to access your Photos" alert. Don't forget to revert CFBundleIdentifier after you end testing.

    0 讨论(0)
  • 2020-12-11 09:16

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

    This is much better than resetting your entire device privacy settings!

    0 讨论(0)
  • 2020-12-11 09:21

    Run the Settings app. Go to General, then Reset. Tap on Reset Location & Privacy. This will reset all of your location and privacy settings, not just for your test app. But you are doing this on a development device so that should be OK. This works in the Simulator too.

    0 讨论(0)
提交回复
热议问题