gpt4 book ai didi

swift - requestRecordPermission 在 ios10 xcode 8 beta 3 中不起作用

转载 作者:可可西里 更新时间:2023-10-31 23:56:54 26 4
gpt4 key购买 nike

当我尝试请求使用麦克风录制的权限时,它会抛出 "[access] "

AVAudioSession.sharedInstance().requestRecordPermission({(granted: Bool)-> Void in
if granted {

print("yass")
} else {
print("Permission to record not granted")
}
})

有人有解决方法吗?这适用于 7.3

最佳答案

如果输出日志是这样的:

2016-07-08 16:41:11.268943 project-name[362:56625] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2016-07-08 16:41:11.272276 project-name[362:56625] [MC] Reading from public effective user settings.
2016-07-08 16:41:11.356590 project-name[362:56700] [access] <private>

您可能缺少相机使用权限。

解决方案是将“Privacy - Camera Usage Description”键添加到您的 Info.plist。

Picture of my plist that works

Here's a link to an Apple Developer Forum discussion explaining why this occurs.

关于swift - requestRecordPermission 在 ios10 xcode 8 beta 3 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38657840/

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