My guess is that Apple made a decision to block on the iOS firewall for some reason (security?), because I noticied that bonjour/zeroconf is not blocked on the tethering (which does not help me at the moment).
If Bonjour is working then it’s unlikely that your app is explicitly blocked, but rather that it’s hard to get multicast right in the general case. The specific issue is that you have to identify the interface you want to multicast on, and there’s no supported way to identify the tethering interface. You can get an interface list (via
getifaddrs
) but you can’t tell them apart in any future proof way.
Honestly, I’m inclined to label this whole approach as unsupported. As I mentioned before, tethering is intended to be a user-level feature for accessing the WWAN, not a developer-level feature for doing TCP/IP over USB communication to apps running on the iOS device. While you might be able to get this working on current versions of iOS, my concern is that it’ll break irrecoverably on future systems.
Imagine that a future version of iOS explicitly blocked apps from talking to the tethering interface. What would break? Well, none of Apple’s stuff would break, because any communications we need to do over the interface is done by system services, not apps. And the user-level tethering feature wouldn’t break, because users tether in order to access the Internet, not the iOS device. OTOH, your app would break, and that’s not a good place to be.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"