masaldana2 masaldana2 - 1 year ago 606
Swift Question

requestRecordPermission not working in ios10 xcode 8 beta 3

when I try to request permission to record with the mic it throws " [access] < private>"

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

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

Anybody got a workaround?
This works with 7.3 tho

Answer Source

If the output log looks like this:

2016-07-08 16:41:11.268943 project-name[362:56625] [MC] System group container for path is /private/var/containers/Shared/SystemGroup/
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>

You might be missing permissions for camera usage.

The solution is to add the "Privacy - Camera Usage Description" key to your Info.plist.

Picture of my plist that works

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download