Our (legacy) code to communicate with peripherals on local IPv6 networks (LAN) adds the zone identifier / interface name ("%en0") to link-local IP addresses (FE80::/10
) discovered via SSDP. SSDP is implemented using CocoaAsyncSocket - yes, that part of our code is old... (from before the introduction of the iOS 12+ Network framework). We use these modified IP addresses as the host component of a URL in a URLSession.dataTask
.
To insert the zone identifier we are using URLComponents
(we modify the host
and then request the string
). This worked fine in iOS 15 and below, but no longer works in iOS 16 (Beta 1/2/3); the host is empty after inserting %en0
in the most recent beta.
We have reported this via FB10549269, but from the answer it is unclear to me whether Apple is planning to fix this ("Resolution: Potential fix identified"), or we are doing it wrong.
How should we handle IPv6 link-local addresses in iOS 16? (when using URLSession
instead of Network
)
PS: We recently dropped support for iOS 12, but we still need to support iOS 13 and up
but from the answer it is unclear to me whether Apple is planning to fix this
This is definitely our bug to fix. That status means that we know what’s gone wrong but the fix isn’t in any currently seeded release. You should be notified when that changes, that is, when the fix makes it into a seed.
How should we handle IPv6 link-local addresses in iOS 16?
Use Bonjour? (-:
Seriously though, Bonjour makes this all much better because the remote peer has a mDNS host name, and you can pass that to URL
rather than monkey around with IP addresses.
But, yeah, I realise that you’re hands are tied by the accessory only supporting SSDP )-:
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"