有没有一种方法可以在应用程序中使用Carplay检测手机是否已与汽车连接/断开连接?
似乎找不到有关它的任何文档。
我正在考虑一些可以监视的系统事件。
最佳答案
您是否遵循了这些步骤?
com.apple.developer.carplay-maps
类型的Boolean
的值为YES
CPApplicationDelegate
协议(protocol)/**
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;
请检查此Documentation link和this WWDC 2018 Carplay Session
关于ios - Carplay连接/断开事件?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52717721/