After working on getting multicast working in my iOS app, I wanted to document things to help give others a leg up down the road as the Xojo information in this space isn’t super comprehensive.
- First Request the com.apple.developer.networking.multicast entitlement from this Apple Developer page.
- Apple will review the request and hopefully get back to you with an approval.
• At least for me this was very much a blackbox process with no confirmation that I placed the request and only an email back from them once approved. At the time of this writing, this process took almost 5 business days (requested over the weekend and approval came in mid-afternoon on Friday) - Once approved, you’ll need to go into the Apple Developer Portal.
- Open the App ID you requested multicast for and you’ll find a new Additional Capabilities tab
- Click this tab and enable the Multicast Networking item.
- Next, go into Profiles and regenerate all profiles using this App ID.
• Once you do step 5, these profiles will become invalid (I forget the exact phrase Apple tags them as) so this will be a good clue as to which need to be regenerated.
• To regenerate them, open each profile, press the Edit button, followed by Save and then Download - Open the downloaded profile files to install them on your Mac.
- Next, you’ll need an entitlement file and @Greg_O has the best solution of creating this within Xcode.
• If you haven’t already done, so create the skeleton for your app within Xcode.
• Add in the Multicast Networking entitlement by selecting your Project » Signing & Capabilities » + Capability » Select Multicast Networking - Within the Finder you’ll find a YourApp.entitlements (certificate looking icon) file within your Xcode app project within the Finder.
• Personally, I copied this file over to my Xojo app project folder, but you can likely store it wherever you desire. - Within Xojo, assign the entitlements to your iOS app.
• Build Settings » iOS » Inspector Pane » Gear tab » Entitlements section » … button
You’re now all set and multicast networking should work for you in your iOS app when you go to production.
Here are some additional references to assist…
- A really great thread on this topic from Jon Ogden and others that gets you most of the way there without all the details I added above.
- Local Network Privacy FAQ from the venerable Quinn “The Eskimo!”
• This is definitely something to be read if you’re going down this path as there’s lots of nuances as to what does and doesn’t require this entitlement that you should be aware of. - Using the Multicast Networking Additional Capability
Also note that if you happen to start using an entitlements file without the proper approval, Xojo will fail to compile your app, but doesn’t speak to this being a problem. I’ve already filed a ticket to try and get the error message to be more descriptive.
For those who have already gone down this road, please chime in with corrections or anything else I might have missed.