iosobjective-cavfoundationmpnowplayinginfocentermpremotecommandcenter

Display Nowplaying item meta in lock screen without playing media on phone


I am writing an app in objective-c and have problems with MPNowPlayingInfoCenter and MPRemoteCommandCenter.

The app plays music on a remote server and I am trying to display this information in the lockscreen / in control center.

So far I don't know a way of displaying nowplaying meta without actually playing audio on the phone.. Does anyone know a solution to show these controls (and meta) without playing audio on the phone ?

(If thats not possible: I heard of a solution where you just play a silent audio file in the background, how can you achieve that?)


Solution

  • Answering my own question, I found out, that it isn't possible to display Nowplaying info without actually playing media on the phone as of now... apple should change that!

    At the moment the best solution I found is to play a 10 second audio mp3 file in an infinite loop - enabling Background audio mode and then you got lockscreen controls as it should be. Attention: At the moment you must provide at least one MPRemoteCommandCenter action, otherwise your Nowplaying won't be updated/displayed

    Hope that helps someone saving their time!