iosmpmediaplayercontroller

Is it possible to use NSNotificationCenter in the background for a Music Player app?


I was wondering if it's possible to run an observer from NSNotificationCenter while the app is in a suspended state, if the selector is required to play music. Basically, it runs at the end of the song to reset the queue. Is it possible to have the selector activate, even if the app is in the background state? I know this seems like a duplicate of this question, however, since my app is a Music Player, is this part of the exception?


Solution

  • In my experience, NSNotificationCenter will not run anything in the background. You'll have to just check some things when you re-initialize the app in the app delegate to change the state or to make it look like things have change when you boot back up. I would love to know if I am wrong though!