iPad删除后记住相机权限

编程入门 行业动态 更新时间:2024-10-27 17:11:28
本文介绍了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:

  • 重置操作系统
  • 卸载应用并等待一天
  • 我知道这两个选项对开发人员来说真的没有帮助,如果他们试图测试它的话.

    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 中所述/a>:

    您可以通过以下步骤实现后者,而无需实际等待一天:

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

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

    第二个选项

    当您删除一个应用程序时,iOS 会将您的应用程序的权限映射到您的应用程序的捆绑包 ID,它会保留一天的数据.因此,您还可以更改应用的 bundle 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删除后记住相机权限

    本文发布于:2023-10-29 20:27:01,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1540656.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:权限   相机   iPad

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!