How to show the Now Playing Tab in CarPlay?

不问归期 提交于 2021-02-08 14:12:43

问题


I'm working on an app that will support CarPlay.It's an audio app.

I'm able to show 2 tabs (favourite and recommended) though I just don't know how to show the Now Playing Tab. I just cannot find any info regarding this. Do I have to manually show it, and the, how do I push? Do I have to do it manually? If so, what's the viewcontroller?

Thanks.


回答1:


For the Transition to the Now Playing tab to work on both the simulator and an actual car, you need to make sure to

  • call beginReceivingRemoteControlEvents on the current UIApplication, and
  • set a nowPlayingIdentifier on the MPPlayableContentManager

before calling the completion handler in playableContentManager:initiatePlaybackOfContentItemAtIndexPath:completionHandler:.




回答2:


I know this post is a couple months old, but for me, I had to test in an actual device with CarPlay. Apple says always test it on an actual device with CarPlay. At first, I didn't see a Now Playing tab in the simulator, but as soon as it was tested in a device it was there automatically. I didn't do anything special. I think CarPlay knows when you're playing audio via MPNowPlayingInfoCenter and does this automatically in the actual CarPlay device.



来源:https://stackoverflow.com/questions/48494859/how-to-show-the-now-playing-tab-in-carplay

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!