gpt4 book ai didi

尝试使用权限时,使用 Adob​​e AIR SDK 24 构建的 iOS 应用程序崩溃

转载 作者:行者123 更新时间:2023-11-29 00:31:20 24 4
gpt4 key购买 nike

我有一个为 iOS 设备开发的 adobe AIR 应用程序,我使用 Adob​​e Flash Builder 4.7 创建 .ipa 文件。

直到 AIR SDK 版本 23 为止,该应用程序都运行良好。在 AIR SDK 版本 24 中,尝试访问设备摄像头时添加了 Permissions 类。现在,在访问相机时应该以编程方式处理权限,如下所示: https://forums.adobe.com/thread/2250328

我尝试在我的代码库中实现给定的示例,在下面的代码片段中,我对权限有空引用,如下所示:

   private function connect():void {      
if (Camera.permissionStatus/*permissionStatus is null*/ != PermissionStatus.GRANTED)
{
cam.addEventListener(PermissionEvent.PERMISSION_STATUS,
function(e:PermissionEvent):void {
if (e.status == PermissionStatus.GRANTED) {
connectCamera();
} else {
// permission denied
}
});

try {
cam.requestPermission(); // **when calling this one my app crashes**
} catch(e:Error) {
// another request is in progress
}
} else {
connectCamera();
}
}

private function connectCamera():void
{
video = new Video(640, 480);
video.attachCamera(cam);
addChild(video);
}

我的预感是,在设备上调试时,Flash Builder 使用的是 flex sdk 而不是 AIR SDK,这使得上述属性/方法不可用,如 SDK 文档中所述:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Camera.html其中可以看到,permissionStatus 方法仅适用于 AIR 运行时。

因此,如何检查并确保我正在使用 AIR 运行时进行调试,并最终避免我的应用程序在向用户请求相机权限时崩溃。

最佳答案

也许是这个? https://forums.adobe.com/thread/2264992

Kindly include cocoa keys under tag in app.xml For Example, If you are trying to access the Camera in your application, you need to include below tag under NSCameraUsageDescription "SOME TEXT"
Please refer to below link for detailed information on cocoa keys: Cocoa Keys

关于尝试使用权限时,使用 Adob​​e AIR SDK 24 构建的 iOS 应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41699442/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com