Receiving Notifications with App in background mode

后端 未结 3 670
悲&欢浪女
悲&欢浪女 2020-12-17 20:20

I have an app, that will keep track of everything the user do in the iPod app. To do this, I added few observers to NSNotificationCenter, like MPMusicPlayerControllerNowPla

3条回答
  •  遥遥无期
    2020-12-17 20:28

    As I explained here iOS receive Media Player Notifications when app is in background, there seems no way to get notifications from iPodMusicPlayer.

    About Omar Raul Qazi answer:

    a) i tried and I had no success. The music kept going down when pressing home button. I think this background flag only works for normal AudioSessions and not for MPMusicPlayer...

    b) I am not sure this would work and I don't think Apple would like it when looking for approval

    c) You can run in background only synchronous task. You cannot wait there for a notification. Am I wrong?

提交回复
热议问题