Note that it’s best to reply as a reply. See Quinn’s Top Ten DevForums Tips for more on that.
davidprivorostrauss wrote:
each variant has it's own Bundle ID.
That’s not great. In general, if two apps have different bundle IDs, you really want them to have different main executable UUIDs.
However, if as you say, no user has installed both apps at the same time, I don’t see how it could trigger this problem.
As to the bigger picture question, it sounds like different folks are seeing it with different protocols. So lemme start with the easier protocol, TCP.
Here’s some trivial test code:
var connectionQ: NWConnection? = nil
func start() -> NWConnection {
print("connection will start")
let connection = NWConnection(to: .hostPort(host: "192.168.1.39", port: 80), using: .tcp)
connection.stateUpdateHandler = { newState in
print("connection did change state, new: \(newState)")
}
connection.start(queue: .main)
return connection
}
func stop(connection: NWConnection) {
print("connection will stop")
connection.stateUpdateHandler = nil
connection.cancel()
}
func startStop() {
if let connection = self.connectionQ {
self.connectionQ = nil
self.stop(connection: connection)
} else {
self.connectionQ = self.start()
}
}
where 192.168.1.39 is a Mac on my local netwok that’s running an HTTP server.
I wired startStop()
up to a button and ran it on an iOS 18 device. When I tap the button I get the Local Network alert. I tapped Don’t Allow and the connection eventually failed with:
connection did change state, new: waiting(POSIXErrorCode(rawValue: 50): Network is down)
I tapped the button again to stop the connection. I then navigated to Settings > Privacy & Security > Local Network and enabled access for my app. Back in the app, I tapped the button again and saw this:
connection will start
connection did change state, new: preparing
connection did change state, new: ready
So, while I’m not gonna deny there’s a problem here, the absolute basics do work.
I’m testing with Xcode 16.1 targeting iOS 18.1. My test device is on iPhone 16 with Wi-Fi but not WWAN.
Can you folks repeat the same test on your devices and let me know what you see? Or if I’ve misunderstood your test process, let me know where I went wrong.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"