4

in iOS7 I was able to set the MPNowPlayingInfoCenter.nowPlayingInfo with the standard stuff (making sure I had an AVAudioSession, with the category AVAudioSessionCategoryPlayback). Everything worked fine. Now with the update to iOS8, the information gets flashed on the screen and then resets to nothing. (The exception is when I first start playing the audio file, and set the data, then lock. If I don't touch anything, then the information stays on screen). I store a dictionary with all the key/values that the info center requires, and see that they contain the correct values when any changes need to be applied (eg if the user taps play/pause, skip buttons).

edit: if I take out my code that updates the info center after play or pause are tapped, the info center is cleared regardless (and I don't have any code that does that). I've gotten around this by dispatch_after with a 200ms delay to adjust the playback rate in the info center. This adds back in everything, however the fact that it's clearing it seems to be a new ios8 bug that I am not properly handling. This is on an iPad 2. :@

Jan Pittner
  • 129
  • 2
  • 6
  • the work around I found was to update the nowPlayingInfo object, and then 200ms later update it again. It seems play/pause clears everything even after you set it, so you have to set it again a short period of time later. – Jan Pittner Sep 10 '14 at 15:05
  • I experience the same thing - however this seems like a haphazard solution to the problem? haven't you found a more solid approach? – darwin Jul 12 '16 at 11:58
  • Haven't looked at it in iOS 9.3.2, so I don't know if the behaviour is the same, sorry. It's a haphazard solution to what to my mind is a bug with the OS. – Jan Pittner Jul 12 '16 at 17:01
  • 1
    The only way I managed to achieve this "properly" was to fotget about the whole MPNowPlayingInfoCenter and rather write metadata directly to the file (artwork, title etc). The metadata seems to be picked up automatically by AVPlayer and is shown in the lock screen. Not an optimal solution though... – darwin Jul 23 '16 at 20:35

0 Answers0