Thanks for the post.
Unfortunately, there is no direct, programmatic way within the iOS SDK to automatically wake or launch your app specifically when the iPhone connects to CarPlay or a standard car Bluetooth system.
Its important to mention your app is completely sandboxed from knowing anything about the CarPlay lifecycle.
As a user, you can create a shortcut on your device.
- Open the Shortcuts app and go to the Automation tab.
- Tap + and select CarPlay or Bluetooth and select. The menu could be a little different.
- Set it to Connects and choose Run Immediately so it doesn't ask for permission every time like shortcuts do.
- For the action, they can select Open App and choose the app you want to run on the iOS device.
Hope that give you an idea.
I hope people do not provide you with ideas using Core Motion or Core Location to wake your app in the background when the user starts moving in a vehicle.
It is advisable to avoid those options due to the potential issues they may cause.
Albert
Worldwide Developer Relations.