Is there a way to detect in an app if the phone was connected/disconnected to/from the car using Carplay? Can't seem to find any documentation regarding it. I'm thinking of some system event like that I could monitor.
Have you followed these steps?
com.apple.developer.carplay-maps
type of Boolean
with value YES
CPApplicationDelegate
protocolImplement the next methods:
/**
The CarPlay screen has connected and is ready to present content.
Your app should create its view controller and assign it to the @c rootViewController property
of this window.
@note It is the responsibility of the delegate to maintain a reference to the interface controller beyond the scope of this method.
*/
- (void)application:(UIApplication *)application didConnectCarInterfaceController:(CPInterfaceController *)interfaceController toWindow:(CPWindow *)window;
/**
The CarPlay screen has disconnected.
*/
- (void)application:(UIApplication *)application didDisconnectCarInterfaceController:(CPInterfaceController *)interfaceController fromWindow:(CPWindow *)window;
Please, check this Documentation link and this WWDC 2018 Carplay Session
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With