Hi there,
we use a UDP broadcast in our iOS application (sending to 255.255.255.255 through GCDAsyncUdpSocket,
which boils down to simple send
through an UDP socket). We have applied for and got the permission to use the com.apple.developer.networking.multicast
entitlement and the application works all right.
What confuses us is when testing, we seem to never see the Local Network authorization dialogue (as shown e.g., here).
Perhaps I did overlook something in the documentation, but I wonder whether this is a normal behaviour, for Apple does not intentionally show this dialogue for the UDP broadcast? Or do we do something wrong at our side? Do we need to set NSLocalNetworkUsageDescription
or not?
Thanks for any insight, OC
To start, check out the Local Network Privacy FAQ. FAQ-2 says that UDP broadcasts require local network access and that gels with my experience. I just ran my LNP test project here in my office and sending a UDP broadcast using BSD Socket definitely triggered the alert.
What OS version are you testing on? I’m testing on iOS 16.2. If you’re testing on iOS 15, be aware that it had some confusing bugs (see FAQ-3).
Do we need to set
NSLocalNetworkUsageDescription
or not?
That’s covered by FAQ-11, albeit in a very ‘language lawyery’ way in that it says “should” rather than “must”. So, yeah, setting this is optional but highly recommended: It’s your chance to convince the user to grant you this privilege.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"