iPad 删除后记住相机权限——如何清除? [英] iPad remembering camera permissions after delete—how to clear?

查看:34
本文介绍了iPad 删除后记住相机权限——如何清除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试重新创建以下代码返回 AVAuthorizationStatusNotDetermined 的条件:

I'm trying to recreate the condition where the following code returns AVAuthorizationStatusNotDetermined:

AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];

然而,即使在删除并重新安装应用程序后,iPad 似乎也会记住相机权限,因此每次都会返回 Authorized 或 NotAuthorized.知道如何重置权限以便返回 NotDetermined 吗?

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?

感谢阅读.

推荐答案

您无法以编程方式重置权限.如果您想重置权限,有两种方法:

You can't reset the permission programmatically. If you want to reset the permission there are two ways:

  1. 重置操作系统
  2. 卸载应用并等待一天

我知道这两个选项对开发人员来说真的没有帮助,如果他们正在尝试测试某些东西.

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.

技术说明TN2265中所述 :

按照以下步骤,您无需等待一天即可实现后者:

You can achieve the latter without actually waiting a day by following these steps:

  • 从设备中删除您的应用.
  • 完全关闭设备并重新打开.
  • 转到设置">一般>日期 &将时间和日期提前一天或更长时间.
  • 再次完全关闭设备并重新打开.

第二个选项

当您删除应用程序时,iOS 会将您应用程序的权限映射到您的应用程序包 ID,并将数据保留一天.因此,您还可以更改应用的捆绑包 ID 以对其进行测试.

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.

正如@rmaddy 在评论中所建议的,您可以重置所有位置和隐私权限:设置 ->一般 ->重置 ->重置位置 &隐私.请注意,这将重置该设备上所有应用所有位置和隐私权限.

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.

这篇关于iPad 删除后记住相机权限——如何清除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆