Receiving Notifications with App in background mode

后端 未结 3 667
悲&欢浪女
悲&欢浪女 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:30

    Multitasking in iOS is currently a very restricted one. You may start a background task using beginBackgroundTaskWithExpirationHandler: method (of an UIApplication object), but it is intended to finish a finite-length task before going suspended. All background tasks may expire (and get terminated) before it finishes its job. You can check how much longer your application can run by checking backgroundTimeRemaining property of the application object.

提交回复
热议问题