Entering background on iOS4 to play audio

后端 未结 2 2025
长情又很酷
长情又很酷 2020-11-29 01:53

The documentation is rather poorly written when talking about playing audio in the background. It gives the impression that all you have to do to continue playing the audio

2条回答
  •  感动是毒
    2020-11-29 02:20

    The one part missing from the documentation is you need to set your audio session.

    [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
    

    Add that and you'll be good to go.

提交回复
热议问题