sneha
sneha

Reputation: 121

bonjour for iPhone

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

Upvotes: 11

Views: 9769

Answers (5)

Srikanth Adavalli
Srikanth Adavalli

Reputation: 685

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

Upvotes: 1

Brad Larson
Brad Larson

Reputation: 170319

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).

Upvotes: 23

Alberto Rossini
Alberto Rossini

Reputation: 149

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

Upvotes: 2

Nikolai Ruhe
Nikolai Ruhe

Reputation: 81868

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

Upvotes: 10

Ole Begemann
Ole Begemann

Reputation: 135548

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

Upvotes: 6

Related Questions