top of page

46. Overview of CarPlay App Development Process

Writer's picture: Hui WangHui Wang

Updated: Sep 5, 2022


1. First, you need to determine whether your app is suitable for CarPlay, access the Apple Developer website to apply for the CarPlay Entitlements of the corresponding app type, and configure the project. Only then can your project use CarPlay Simulator. Therefore, applying for entitlements in advance is best if you plan to develop a CarPlay app because Apple's review will take time. You can look at the relevant development documents during this period and use the CarPlay Simulator to debug and develop after applying for the entitlements.

Apply for CarPlay Entitlements:


2. Starting from iOS 14, you can use the CarPlay framework to develop an audio CarPlay app (You can use it in iOS 12 if it is a navigation app), which provides some UI templates to support developers' custom interfaces.

If your project is compatible with iOS 13 and earlier, it needs to be developed using the MediaPlayer framework, which is forward compatible.

Therefore, if your app needs to use the CarPlay framework on iOS 14 and later and is compatible with iOS 13 and earlier, you need to maintain two sets of code, and the development effort may nearly double.

I will only consider iOS 14 and above here. If you want to support lower versions, please check out WWDC17 and WWDC18.


3. Using the CarPlay framework in iOS 14 and later to develop a CarPlay app must use UIScene (Apple introduced UIScene in iOS 13 for building multi-window applications), so your project must change from traditional UIWindow and AppDelegate to SceneDelegate. You can skip this step if your project is already compatible with UIScene.


4. The CarPlay app is attached to the iPhone app, so they are the same process.

  • If you start the CarPlay app, the system will start your iPhone app in the background.

  • If the iPhone app process is killed, the CarPlay app will also close. In UIScene, it is to disconnect the scene.

  • If you close the CarPlay app, it means disconnecting the scene in UIScene. However, the system will not kill the iPhone app process.

  • All CarPlay apps will be closed only if the entire CarPlay is exited, and there is no way to close the specified CarPlay app.

  • In iOS 13, Apple has improved CarPlay so that one CarPlay app and iPhone app can be in the background and the other in the foreground. Before iOS 13, the CarPlay and iPhone app were highly bound and could only be in the foreground or background together, resulting in a poor user experience. So, for example, when you're navigating with CarPlay, your phone won't be able to do anything else that would interrupt the navigation process.


5. To develop an audio-type CarPlay app, start from the CPTemplateApplicationSceneDelegate to build the UI and fill in the data.

The user interface of a CarPlay app is relatively fixed, but with the CarPlay framework, Apple can support more customizable UIs.

When the car is connected, the audio will be played through the car speakers. Whether you use the CarPlay or the MediaPlayer framework to build a CarPlay app, MPNowPlayingInfoCenter and MPRemoteCommandCenter provide audio information for the playback interface and respond to remote playback control events.

In the CarPlay framework, some remote control events are handled by the handler of CPNowPlayingButton, such as playback mode, playback speed, and so on.

Suppose your app is an audio type. In that case, it should already support these functions because the iPhone lock screen and the audio playback information and control of the control center are also provided through them. Therefore, we only need to optimize or enhance the function of CarPlay.

  • Set and update the MPNowPlayingInfoCenter's nowPlayingInfo, which contains metadata about the currently playing audio, such as title, author, duration, etc.

  • Respond to MPRemoteCommandCenter events to respond to remote playback control events such as play, pause, switch songs, etc. In addition to the above two points, you may also need:

  • Set and update the playbackState of MPNowPlayingInfoCenter to update the audio playback state displayed on the CarPlay app: play/pause.

  • Set and update the MPRemoteCommandCenter's changeRepeatModeCommand.currentRepeatType to update the playback mode status displayed on the CarPlay app: sequential loop/single loop. Even if your app does not plan to support CarPlay yet, you can use it by adapting MPNowPlayingInfoCenter and MPRemoteCommandCenter to make your app supports CarPlay "Playing" apps.


6. Understand what functions and UIs are supported by the CarPlay framework, and then help your PM and UI designer to complete requirements, prototypes, and designs. Learning to use UI, the interface is composed of Template and Item, commonly used CPTabBarTemplate, CPListTemplate, CPListItem, CPListImageRowItem, CPGridTemplate, and so on.


7. You can start developing the CarPlay app.


8. You can test your CarPlay app in a real environment (in a car) or through the latest CarPlay Simulator from WWDC22.

In addition, Apple recommends that we test the user experience in a weak network and no network environment because the driving process may pass through roads or areas with a poor network.


Introduction of WWDC22 CarPlay Simulator:


Use CarPlay Simulator to run and debug some untestable features in your CarPlay app:


9. Apple provides an example of an audio-type CarPlay app for your reference.


CarPlay app example:


 

Follow me on:

Comments


Never Miss a Post. Subscribe Now!

I am an iOS developer, and I will share some knowledge related to iOS development from time to time.

Thanks for submitting!

© 2022 by (Foks) Hui Wang

bottom of page