Connected to CarPlay

What's the simplest way to programmatically detect the iPhone is connected to CarPlay? (not necessarily having your app launched)

Answered by Frameworks Engineer in 891318022

There is no API available for detecting if CarPlay is connected, but related APIs help with common reasons why an app might want to detect if CarPlay is connected:

  1. Core Motion's CMMotionActivity automobile can be used for detecting if the device is likely to be in a vehicle, including driving scenarios without CarPlay connected.
  2. For apps that appear in CarPlay, the CPTemplateApplicationSceneDelegate in the CarPlay framework allows the app to determine if their app's template UI in CarPlay is appearing / disappearing as CarPlay connects or disconnects.
Accepted Answer

There is no API available for detecting if CarPlay is connected, but related APIs help with common reasons why an app might want to detect if CarPlay is connected:

  1. Core Motion's CMMotionActivity automobile can be used for detecting if the device is likely to be in a vehicle, including driving scenarios without CarPlay connected.
  2. For apps that appear in CarPlay, the CPTemplateApplicationSceneDelegate in the CarPlay framework allows the app to determine if their app's template UI in CarPlay is appearing / disappearing as CarPlay connects or disconnects.
Connected to CarPlay
 
 
Q