xcode - MPNowPlayingInfoCenter info is not displayed on iOS 8

后端 未结 4 1456
别那么骄傲
别那么骄傲 2020-12-05 12:19

I\'m developing a music application, which should play music in the background.

I use the MPMoviePlayerController to play the music. My code to initiate

4条回答
  •  伪装坚强ぢ
    2020-12-05 12:59

    Expanding further on @matt's answer, it's required that you call endReceivingRemoteControlEvents and resignFirstResponder when the app comes back into the foreground (applicationDidBecomeActive). Otherwise the OS assumes you are a bad actor (or forgot to turn them off) and turns off your ability to show the sleep controls entirely, even after you call beginReceivingRemoteControlEvents again. I added these calls and now the Sleep Controls always show when they should.

提交回复
热议问题