eugenebokhan / bonjour

Easy-to-use Bonjour Service for iOS and macOS.
MIT License
51 stars 9 forks source link

Bonjour

Bonjour is a little service for easy communication with bonjour protocol supported devices.

Requirements

Install via SwiftPM

.package(url: "https://github.com/eugenebokhan/Bonjour.git",
         .upToNextMinor(from: "2.1.0"))

How To Use

Info.plist configuration

In order for BonjourSession to work when running on iOS 14, you will have to include two keys in your app's Info.plist file.

The keys are Privacy - Local Network Usage Description (NSLocalNetworkUsageDescription) and Bonjour services (NSBonjourServices).

For the privacy key, include a human-readable description of what benefit the user gets by allowing your app to access devices on the local network.

The Bonjour services key is an array of service types that your app will browse for. For BonjourSession, the entry should be in the format _servicename._tcp, where servicename is the serviceType you've set in your MultipeerConfiguration. If you're using the default configuration, the value of this key should be _Bonjour._tcp.

If you do not configure the above keys properly, then BonjourSession won't work.

License

Project's license is MIT.