When using the official Wi-Fi Aware demo app on iOS, with the iOS device configured as a NAN Subscriber, after successfully establishing a peer-to-peer connection with another device via Wi-Fi Aware (NAN), the network path object nwPath.availableInterfaces does not list the nan0 virtual network interface. The nan0 interface is the dedicated NAN (Neighbor Aware Networking) interface used for Wi-Fi Aware data communication. Its absence from availableInterfaces prevents the app from correctly identifying/using the NAN data path, breaking expected Wi-Fi Aware data transmission logic.
log: iOS works as subscriber: [onPathUpdate] newPath.availableInterfaces: ["en0"]
iOS works as publisher: [onPathUpdate] newPath.availableInterfaces: ["nan0"]
we need to establish multiple additional NWConnection instances … over the Wi‑Fi Aware network
I don’t think you can do this on currently shipping systems. However, we’ve added support for it in iOS 26.4 beta. This is sufficiently ‘bleeding edge’ that the docs haven’t hit the Developer website yet. But the APIs are in the iOS 26.4 beta SDK (I’m using Xcode 26.4b3, build 17E5179g) and there’s documentation in Xcode itself.
To set up a listener:
let devices: WAPublisherListener.Devices = … specific devices …
let listener = try NetworkListener(for:
.wifiAware(.addingConnections(from: devices)),
using: .parameters({
TCP()
}).localPort(12345))
On the client side, do this:
let connection: NetworkConnection<TCP> = … original connection …
guard let wifiAwareEndpoint = connection.currentPath?.remoteEndpoint?.wifiAware(port: 12345) else {
// … handle the failure …
}
// … connect to that endpoint …
If you option click on addingConnections and wifiAware, you’ll get docs for each.
Oh, and you don’t want to hard code the port number here. Rather, let the listener choose an ephemeral port and then pass the port number to the client via your initial Wi-Fi Aware connection.
As you might imagine, I haven’t actually test this for myself yet. But it’s in the SDK and AFAIK it should work.
send URLSession requests
How does URLSession fit into this? AFAIK you can’t configure URLSession to run over a specific interface, let alone Wi-Fi Aware.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"