ios 多任务相机访问权限需要很长时间才能响应

46qrfjad  于 2023-01-03  发布在  iOS
关注(0)|答案(1)|浏览(413)

我正在开发聊天/视频通话应用程序,然后我想相机继续运行时,应用程序在后台。
然后我发送请求以获取***多任务摄像头访问权限***
经过请求,我得到了邮件回复:

Dear Developer,

Your request to use the Multitasking Camera Access Entitlement has been received. We'll review your information and contact you soon with a status update.

Best regards,
Multitasking Camera Access Requests Team

但我从来没有得到接受,即使我要求3次,第一次从1年前。
有人遇到同样的问题吗?

uoifb46i

uoifb46i1#

切换到iOS 16的最低部署目标应该可以解决这个问题,因为根据https://developer.apple.com/documentation/avfoundation/capture_setup/accessing_the_camera_while_multitasking,这些要求已经被删除
文档并不完全准确,因为它只适用于具有舞台管理器可用的iPad。
下面是一个示例应用程序:

import Foundation
import AVKit

/// Camera Permission Check
/// Requires iPad with Stage Manager Support
/// e.g. iPad Pro (11-inch) 4th generation with iOS 16.1
///
/// Containing app must have iOS deployment target 16.0
class CameraPermissionCheck {
    
    let captureSession = AVCaptureSession()
    init() {
        // Configure the capture session.
        captureSession.beginConfiguration()
        if captureSession.isMultitaskingCameraAccessSupported {
            // Enable using the camera in multitasking modes.
            captureSession.isMultitaskingCameraAccessEnabled = true
            print("MultiTasking Camera Access Enabled")
        }
        captureSession.commitConfiguration()

        // Start the capture session.
        DispatchQueue.global().async {
            self.captureSession.startRunning()
        }
    }
}

它将向控制台打印MultiTasking Camera Access Enabled

相关问题