presentAudioRecordingControllerWithOutputURL not recognized in WatchKit project

225 views Asked by At

I have an existing project for WatchKit and with the new WatchOS release Apple have implemented a method called presentAudioRecordingControllerWithOutputURL to record audio from AppleWatch.

When I call this method I have two compilations errors. I imagine that I have to add or include something more but I don't know what I have to change in my project.

enter image description here

Errors:

/path/myProject WatchKit Extension/AWMessagesController.m:278:56: 'WKAudioRecordingPresetWideBandSpeech' is unavailable: not available on iOS

/path/myProject WatchKit Extension/AWMessagesController.m:277:11: 'presentAudioRecordingControllerWithOutputURL:preset:maximumDuration:actionTitle:completion:' is unavailable: not available on iOS
1

There are 1 answers

0
John On BEST ANSWER

presentAudioRecordingControllerWithOutputURL cannot be used in an iOS extension. You have to migrate your code appropriately (e.g., copy files to the watch target). Refer to Apple's documentation.