iOS18 UDP failed to send data

iOS18 UDP fails to send data, iOS other systems fine

  1. Device discovery by broadcasting over UDP
  2. Failed to send data to the discovered device using UDP communication
  3. This problem only occurs on iOS18, other iOS versions work fine

I read the official forum of Apple, it is recommended to use BSD socket to send data, and it cannot be sent on iOS18. I suspect that the device privacy permission is found locally, which is invalid on iOS18

This problem is serious for us at present Hope to receive it ASAP. Your Recovery

iOS 18 has not introduced any new rules with regards sending and receiving UDP. My experience is that a lot of UDP code is brittle, meaning that it can break on major OS release or on specific devices.

The underlying reason for that is that a of UDP code is based on BSD Sockets, and BSD Sockets is a hard API to use correctly. Normally I’d suggest a switch to Network framework, but in this case that’s not viable because your implementing a service discovery protocol using UDP broadcasts.

My general advice on that front is that you stop doing that, and instead adopt Bonjour [1]. However, I recognise that this isn’t feasible if you’re working with someone else’s accessory (OTOH, if you do control the accessory firmware then you should definitely lean on the firmware folks to just do this already).

As to how you fix things right now, I have a bunch of advice in this space in my Extra-ordinary Networking post. Specifically, follow the link to Don’t Try to Get the Device’s IP Address and look in the Service Discovery section.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] Bonjour is an Apple term for three industry-standard protocols:

My application also crashes when attempting to communicate via UDP.

I’m facing the same problem as you. Have you managed to solve it? I’d appreciate any advice or ideas you might have on how to resolve it.

I do not have any control over an app which runs on a computer, while MY APP uses UDP to communicate with the third party app. I cannot choose another type of implementation, and I have an older iPad running iPadOS 16.7.10 that still functions properly, while my iOS 18.x devices do not. Is this problem being addressed, or is the app I spent 6 months making in order to take advantage of pre-defined inter-app communication now useless?

I answered my own issue, and thought maybe somebody else could use this: My app has the UDP Multicast entitlement, and I assumed all the hoops I'd jumped through to get that running was adequate, and before iOS 18, it was. With iOS 18, I also needed to specifically have an info.plist entry for Privacy - Local Network Usage Description because without it the user would not be prompted for their permission. With it, it all works again.

iOS18 UDP failed to send data
 
 
Q