你好 iPhone 版

发布于 2024-08-25 14:21:23 字数 57 浏览 2 评论 0原文

我想知道 bonjour 是公共 api 还是私有 api?我们可以直接在我们的应用程序中使用它吗?

I would like to know whether bonjour is a public or private api? Can we use it in our apps directly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

霊感 2024-09-01 14:21:23

Bonjour 由 NSNetServices 和 CFNetServices API 处理,您可以阅读有关 这里。这些是 Cocoa 和 Core Foundation 接口,可公开用于 Mac 和 iPhone 应用程序。正如已经指出的那样,许多应用程序利用它来进行 iPhone - iPhone 网络(例如,Game Kit 位于 Bonjour 之上)或 Mac - iPhone 数据同步(例如 Marcus Zarra 的 ZSync 库)。

Bill Dudney 为 iPhone 创建了一个精简的 Bonjour 服务器类,他在此处。我创建了一个匹配的 Mac 应用程序,它与他的测试应用程序进行通信,可以从 此处下载< /a>. Apple 的 WiTap 示例代码演示了如何使用 Bonjour 将两部 iPhone 联网。

我在 iPhone 开发课程中专门讲授了 Bonjour 网络的一部分,该课程的课程笔记可以以 VoodooPad 格式下载 此处(请参阅网络课程以了解相关内容)。

Bonjour is handled by the NSNetServices and CFNetServices APIs, which you can read more about here. These are Cocoa and Core Foundation interfaces, and are publicly available for use in Mac and iPhone applications. As has been pointed out, many applications make use of this to do iPhone - iPhone networking (Game Kit is layered on top of Bonjour, for example) or Mac - iPhone data syncing (such as for Marcus Zarra's ZSync library).

Bill Dudney has created a stripped-down Bonjour server class for the iPhone, which he describes here. I created a matching Mac application which communicates with his test application and can be downloaded from here. Apple's WiTap sample code demonstrates how to use Bonjour to network two iPhones together.

I devoted a section of the class I teach on iPhone development to Bonjour networking, for which the course notes can be downloaded in VoodooPad format here (go to the Networking class for coverage of this).

唔猫 2024-09-01 14:21:23

Apple 甚至有一个名为 BonjourWeb 的示例项目,它向您展示了如何在 iPhone 上使用 Bonjour。

Apple even has an example project called BonjourWeb that shows you how to use Bonjour on the iPhone.

ゃ人海孤独症 2024-09-01 14:21:23

是的,Bonjour 是公开的。 App Store 上有很多应用程序都使用它。

Yes, Bonjour is all public. There are many apps on the App Store that use it.

伪心 2024-09-01 14:21:23

Bonjour API 似乎是开放的,但它确实属于 Apple,您需要确保您获得了正确的许可。例如,如果您希望使用 Bonjour 徽标、在 Windows 上开发支持 Bonjour 的应用程序,您可能需要许可证。

欲了解更多信息,请参阅:
http://developer.apple.com/softwarelicensing/agreements/bonjour.html

The Bonjour API seems to be open, however it does belong to Apple and you need to ensure you're correctly licensed. You will likely require a license if you wish to use the Bonjour logo, develop Bonjour enabled applications on Windows, for example.

For further info see:
http://developer.apple.com/softwarelicensing/agreements/bonjour.html

那小子欠揍 2024-09-01 14:21:23

是的! Bonjour 是公共 API。

是的,您可以用于您的应用程序。对于发布服务,您需要使用 NSNetService;对于浏览,您需要使用 NSNetServiceBrowser 委托。您可以使用 NSStream 发送数据。确保与 bonjour 设备进行通信。设备必须位于同一个 Wi-Fi 路由器中

Yes! Bonjour is Public API.

Yeah you can use for your applications. For Publishing the Service you need to use NSNetService and for Browsing you need to use NSNetServiceBrowser Delegates. You can send data using NSStream. Make sure in order to communicate with bonjour devices. Devices must be in same Wi - Fi Router

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文