Hi all,
i am trying to develop simple app which would allow user to record audio using his apple watch.
I am testing both on simulator and on real device too. Recording in simulator works fine. However for some reason when testing on real device (watch) watch is never asking for microphone permissions (dialog is not shown) that means that it seems that audio is being recorded but it is not.
I have tried 2 possible approaches:
1. use presentAudioRecorderController to use built-in audio recorder
2. use AVAudioSession + AVAudioRecorder to handle recording manually. I
// When using option 2 I am also explicitly asking for permission:
let recordingSession = AVAudioSession.sharedInstance()
do {
try recordingSession.setCategory(.playAndRecord, mode: .default, policy: .default, options: [])
try recordingSession.setActive(true)
recordingSession.requestRecordPermission { (hasPermission) in
if hasPermission {
print("accepted")
}
}
}
catch {
print("Couldn't set Audio session category")
}
However in any of those approaches app never asks for permission. Also I have NSMicrophoneUsageDescription key in both app info.plists (iphone & watch extension)
Device specs:
iPhone X running iOS 13.1.3
watch series 3 (38mm) running watchOS 5.3.2
Thanks for your help.