The issue was the Local Privacy Network dialog not showing. I was a bit unclear on this. I didn't believe this was needed to receive UDP but in our case it seems it is required. This is using the CocoaAsyncSocket library GCDAsyncUdpSocket. We discovered this when a gentleman was testing on a local host. The app uses both tcp/ip for some communication and udp for external gps. The tcp/ip communication on the local network triggered the dialog I believe since it does have outgoing messaging. When accepting the UDP receive started working. I did see there was a bug that is noted that only outgoing messaging on the local network will trigger the local privacy network dialog. To resolve we just access the local hostname which triggers the dialog.
I have not delved into the GCDAsyncUdpSocket library nor a network expert by any means. We are binding to a specific known port to listen. It is possible that this is maybe something underlining within the library we are using. This may not be a thing with NSConnection. I do agree with tts320 that maybe just binding to the port should trigger this dialog as well. It seems everything but the receive on unicast requires it. Also I didn't see a good way, similar to internal GPS, when the dialog appears handling a callback to know exactly if it was authorized or not. This may be different with NWConnection. I have not looked at that completely and is something we may move to in the future but currently just need it to work.
Thank you for your help and comments with this.
Topic:
App & System Services
SubTopic:
Core OS
Tags: