如何第二次在iOS中请求照片库权限 [英] How can you request photo gallery permissions in iOS a second time
问题描述
在我的iOS应用中,我正在访问用户的照片库.用户第一次执行此操作时,它会要求他们许可.我的一些用户报告这是由于权限请求而导致的第一次崩溃,但在以后的尝试中效果很好.
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 first time due to the permission request, but it works fine on subsequent tries.
要能够自己进行测试,我需要能够从iPad中删除该权限,然后再次提示.是否可以通过iPad/iPhone本身或通过代码来做到这一点?
To be able to test this on my own, I need to be able remove the permission from my iPad and have it prompt again. Is there a way to do this either through the iPad/iPhone itself or through code?
推荐答案
运行设置"应用程序.转到常规,然后重置.点击重置位置"隐私.这将重置您的所有位置和隐私设置,而不仅仅是针对您的测试应用.但是您正在开发设备上执行此操作,因此应该可以.这也可以在模拟器中使用.
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.
这篇关于如何第二次在iOS中请求照片库权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!