I tried this to obtain microphone access:
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeAudio completionHandler:^(BOOL granted) {
if (granted) {
g_message("granted microphone access");
}else{
g_message("not granted microphone access");
}
}];
Further I added these keys and values to Info.plist:
<key>NSCameraUsageDescription</key>
<string>Only microphone used.</string>
<key>NSMicrophoneUsageDescription</key>
<string>The application uses your microphone.</string>
And the sandbox and hardening entitlements:
<key>com.apple.security.device.audio-input</key>
<true/>
<key>com.apple.security.device.microphone</key>
<true/>
But it didn't work.
Topic:
Privacy & Security
SubTopic:
General
Tags: