iOS CarPlay API 是公开的吗?如何整合 CarPlay?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22372095/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 23:43:36  来源:igfitidea点击:

Is iOS CarPlay API Public? How to Integrate CarPlay?

ioscarplay

提问by Tibor Udvari

Is the CarPlay APIpublicly available?

CarPlay API公开的吗?

Where can we find a programming guide or the reference to these classes if it is?

如果有的话,我们在哪里可以找到编程指南或对这些类的参考?

Or will it integrate seamlessly with other APIs like Audio from AVFoundation?

或者它会与其他 API 无缝集成,比如 Audio fromAVFoundation吗?

Notes

笔记

  • This question is broad and may be flagged as so but please do not as though there is almost no information on the subject and a lot of people could find it useful at this stage
  • I live in Switzerland and want to go to Genevato try out a demo app that I would write on a Ferrarilol.
  • 这个问题很广泛,可能会被标记为如此,但请不要以为几乎没有关于该主题的信息,很多人在现阶段会发现它很有用
  • 我住在瑞士,想去日内瓦试用一个我会在法拉利上写的演示应用程序,哈哈。

采纳答案by Juli?n

Update Oct, 2019:
A couple of years later, Apple opened up their designer guidelinesand developer docson CarPlay. As mentioned in some other comments as well, getting access to developer tools can be done on your mac as well.

2019 年 10 月更新:
几年后,Apple在 CarPlay 上开放了他们的设计师指南开发人员文档。正如其他一些评论中所提到的,也可以在您的 Mac 上访问开发人员工具。

Technically, depending on the type of appyou want to be compatible with CarPlay, it requires different API's and frameworks. For example:

从技术上讲,根据您希望与 CarPlay 兼容的应用程序类型,它需要不同的 API 和框架。例如:

The CarPlay framework is for use by navigation apps only. If you want to add CarPlay support to your audio app, use MPPlayableContentManager. For messaging apps, use SiriKit's Messaging-related intents to support reading and sending messages in CarPlay through Siri. For VoIP calling apps, use CallKit with SiriKit's VoIP Calling-related intents to make and answer audio calls on a CarPlay system.

CarPlay 框架仅供导航应用程序使用。如果您想为您的音频应用程序添加 CarPlay 支持,请使用 MPPlayableContentManager。对于消息类应用,使用 SiriKit 的 Messaging 相关 Intent,支持通过 Siri 在 CarPlay 中阅读和发送消息。对于 VoIP 通话应用程序,将 CallKit 与 SiriKit 的 VoIP 通话相关意图一起使用,以在 CarPlay 系统上拨打和接听音频电话。

Legally, however, still the MFi Programrequires application and approval by Apple for you to get the appropriate permissions, signing profile etc. in order to deploy it on an actual device. Let alone release it to market. OR... you can try applying for access manuallyand explain your case.

然而,从法律上讲,MFi 计划仍然需要 Apple 申请和批准,以便您获得适当的权限、签署配置文件等,以便将其部署到实际设备上。更不用说将其投放市场了。或者...您可以尝试手动申请访问权限并解释您的情况。

Lastly, there is also some documentationon how to enable tools and simulator to work with CarPlay. For example, a small excerpt:

最后,还有一些关于如何使工具和模拟器与 CarPlay 配合使用的文档。例如,一小段摘录:

CarPlay is supported by default when you run Simulator. However, you should configure the Simulator with extra options when developing a CarPlay navigation app. To enable extra options, enter the following command in Terminal before launching Simulator: defaults write com.apple.iphonesimulator CarPlayExtraOptions -bool YES.

运行模拟器时默认支持 CarPlay。但是,在开发 CarPlay 导航应用程序时,您应该为模拟器配置额外的选项。要启用额外选项,请在启动模拟器之前在终端中输入以下命令:defaults write com.apple.iphonesimulator CarPlayExtraOptions -bool YES.

But besides the documentation I can seriously recommend to read what the people at Flitsmeister blogged abouton how to enable tooling on your local machine. Also, their road to finally getting approved was apparently tedious and far from smooth (I'm not affiliated with Flitsmeister), even though their use case is based on having lots of users (±1.5mln). Mentioning this to emphasise: CarPlay is apparently still not for the every day developer, just yet.

但除了文档之外,我还可以认真推荐阅读Flitsmeister的人在博客上关于如何在本地机器上启用工具的内容。此外,他们最终获得批准的道路显然是乏味的,而且远非一帆风顺(我不隶属于 Flitsmeister),即使他们的用例是基于拥有大量用户(±150 万)。提到这一点是为了强调:CarPlay 显然仍然不适合日常开发人员,只是还没有。



This question dates of early 2014. Let me update this with a mid 2016 answer:

这个问题的日期是 2014 年初。让我用 2016 年年中的答案更新这个:

TL;DR - No, it is not publicly available.

TL;DR - 不,它不是公开可用的。

In order to get the tools, documentation, technical specs and even the license itself to develop for (amonst others) Carplay, you need to be enrolled with Apple's MFi Program.

为了获得工具、文档、技术规范甚至许可证本身来为(以及其他人)Carplay 进行开发,您需要注册Apple 的 MFi 计划

Apple's MFi Program("Made for iPhone/iPod/iPad") is a licensing program for developers of hardware and software. This is a specific license targeted at manufacturers, mostly of "mass production" units, that has additional benefits over the regular developer accounts for companies. These benefits include hardware components, tools, docs, techsupport and of course the license that you are allowedto develop specifically for these devices and technologies, like Carplay.

Apple 的 MFi 计划(“Made for iPhone/iPod/iPad”)是一项面向硬件和软件开发人员的许可计划。这是针对制造商的特定许可证,主要是“批量生产”单位,与公司的常规开发人员帐户相比具有额外的好处。这些好处包括硬件组件、工具、文档、技术支持,当然还有你可以专门为这些设备和技术开发的许可证,比如 Carplay。

The MFi Enrollment FAQis a decent read that makes everything pretty clear. But before you get your hopes up, do note that -again- it is only available for manufacturers. Like the FAQ states:

MFI招生常见问题是一个体面的读取,使一切都非常清楚。但在你抱有希望之前,请注意 - 再次 - 它仅适用于制造商。就像常见问题解答一样:

Q: Am I eligible to apply for the MFi Manufacturing License if my company does not own a manufacturing facility?

A: No. The MFi Manufacturing License is intended solely for companies that own one or more manufacturing facilities.

问:如果我的公司没有制造设施,我是否有资格申请 MFi 制造许可证?

答:不可以。MFi 制造许可证仅供拥有一个或多个制造设施的公司使用。

There are some exceptions. For example if you're a contractor, or an engineering design firm, that develops MFi accessories for a client (who is a manufacturer).

有一些例外。例如,如果您是为客户(制造商)开发 MFi 配件的承包商或工程设计公司。

But basically put, it is not for the average developer and admission is quite strict. This means, in a nutshell, that Apple Carplay is not available to developer for by the, say, 95% of us.

但基本上来说,它不是针对普通开发人员的,而且准入非常严格。简而言之,这意味着我们 95% 的开发人员无法使用 Apple Carplay。

回答by Leo Natan

The MusicCarDisplayUI.frameworkframework is a private framework as of iOS 7.1. Taking a look at the runtime headersof the framework, one can guess why; it's just not ready yet for wide use. Whether Apple will make it public in the future is one's guess.

MusicCarDisplayUI.framework框架是 iOS 7.1 的私有框架。看看框架的运行时标头,就可以猜到原因了;它只是还没有准备好广泛使用。苹果是否会在未来公开它是一个猜测。

In the meantime, make sure to open a feature requestor directly contact Apple here.

同时,请确保在此处打开功能请求或直接联系 Apple 。



Update: If you wish to have a CarPlay-enabled app, contact Apple using this form.

更新:如果您希望拥有支持 CarPlay 的应用程序,请使用此表格联系 Apple 。

回答by Aaron Zhou

Just worked on carplay project.

刚刚在carplay项目上工作。

  1. You can find the api documents on apple's developer website. Like MPPlayableContentManagerand MPContentItem.
  2. However only after registered on apple's website for carplay, will apple send you the "Carplay Programming Guide" telling you how to activate the car simulator and what classes to use and how to do things etc.
  1. 你可以在苹果的开发者网站上找到 api 文档。像MPPlayableContentManagerMPContentItem
  2. 但是只有在苹果官网上注册了carplay之后,苹果才会给你发《Carplay编程指南》告诉你如何激活汽车模拟器,使用什么类,怎么做等。

回答by Boon

Take a look at MediaPlayer Framework. There are a bunch of classes in there designed for CarPlay only. For example, MPPlayableContentManager, MPContentItem, etc. Obviously, you won't be able to deploy it via the AppStore without Apple's approval.

看看 MediaPlayer 框架。那里有很多专为 CarPlay 设计的课程。例如MPPlayableContentManagerMPContentItem等。显然,你将无法通过AppStore上没有苹果的批准部署。

回答by Mehdi Chennoufi

Partially since iOS 12.0 : https://developer.apple.com/documentation/carplay

部分自 iOS 12.0 起:https: //developer.apple.com/documentation/carplay

The CarPlay framework is for use by navigation apps only. If you want to add CarPlay support to your audio app, use MPPlayableContentManager. For messaging apps, use SiriKit's Messaging-related intents to support reading and sending messages in CarPlay through Siri. For VoIP calling apps, use CallKit with SiriKit's VoIP Calling-related intents to make and answer audio calls on a CarPlay system.

CarPlay 框架仅供导航应用程序使用。如果您想为您的音频应用程序添加 CarPlay 支持,请使用 MPPlayableContentManager。对于消息类应用,使用 SiriKit 的 Messaging 相关 Intent,支持通过 Siri 在 CarPlay 中阅读和发送消息。对于 VoIP 通话应用程序,将 CallKit 与 SiriKit 的 VoIP 通话相关意图一起使用,以在 CarPlay 系统上拨打和接听音频电话。