有没有办法在应用程序中检测手机是否使用 Carplay 与汽车连接/断开连接?似乎找不到任何关于它的文档。我正在考虑一些我可以监控的系统事件。
您遵循这些步骤了吗?
com.apple.developer.carplay-maps类型为Boolean带值YESCPApplicationDelegate协议实现以下方法:
/**
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;
Run Code Online (Sandbox Code Playgroud)请查看此文档链接和此 WWDC 2018 Carplay 会议
| 归档时间: |
|
| 查看次数: |
1714 次 |
| 最近记录: |