How to show the Now Playing Tab in CarPlay?

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?

Replies

Did you ever find a solution for this problem? I'm having the same problem.

The tree-based item list works fine, and even playback works ok, but I can't find the magic incarnation to make the NowPlaying screen show up in the actual car.


I got it to appear in the simulator by doing a suspicious dance of


```

[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];

[[UIApplication sharedApplication] endReceivingRemoteControlEvents];

```


before calling the completion handler in `-(void)playableContentManager:(MPPlayableContentManager *)contentManager initiatePlaybackOfContentItemAtIndexPath:(NSIndexPath *)indexPath completionHandler:(void(^)(NSError * __nullable))completionHandler`, however that does not make it work in the car.


Is there _a single_ fully functioning CarPlay audio example program available anywhere? github shows nothing.

You should set MPNowPlayingInfoCenter.default().nowPlayingInfo before calling completionHandler of


playableContentManager(_ contentManager: MPPlayableContentManager, initiatePlaybackOfContentItemAt indexPath: IndexPath, completionHandler: @escaping (Error?) -> Void)


it's working for me