如果用户拒绝访问摄像头或麦克风,我会在收到带有自定义提醒的应用程序的呼叫时请求许可

func showAlertForDeniedPermissions(message:String) {
    if let settingsUrl = URL(string: UIApplicationOpenSettingsURLString)  {
        let alert = UIAlertController(title: "Access Needed!", message: message, preferredStyle: UIAlertControllerStyle.alert)
        let okay = UIAlertAction(title: "OK", style: .default, handler: { (action) in
            // If camera or library settings are disabled then open general settings
            if UIApplication.shared.canOpenURL(settingsUrl) {
                UIApplication.shared.open(settingsUrl, options: [:], completionHandler: nil)
            }
        })
        alert.addAction(okay)
        self.present(alert, animated: true, completion: nil)
    }
}

如果用户点击正常,将打开应用程序设置,并在后台呼叫将继续 . 如果用户启用了摄像头或麦克风的权限,则呼叫会断开连接,并且当我调试它时,app会再次启动

Message from debugger: Terminated due to signal 9