How do I set the Audio Session Category for an iMessage App Extension?

133 views Asked by At

I'm working on an iMessage App Extension using Xamarin.iOS where interacting with videos with audio is critical to its functionality. Right now though, if the silence switch is toggled to silence, then the video will playback without audio. I want to set the category to Playback to ignore the switch, but this seems to have no effect. No error is being returned. I know that some Shared interfaces cannot be accessed in an App Extension. Is there another way to set the category?

NSError error = AVAudioSession.SharedInstance().SetCategory(AVAudioSessionCategory.Playback);
if (error != null)
{
    Debug.WriteLine($"SetCategory error {error.ToString()}"); 
}
0

There are 0 answers