Error when sending UDP packets on WatchOS 6

Hello,


I am using an NWConnection object to send a UDP packed from the an Apple Watch to a network server. Everything works fine as long as the watch is connected to the iPhone. The network trace shows the packets are send from the iPhone's wifi IP.


If I put the iPhone in Airplane mode and the watch is using it's own wi-fi network, the UDP connection remains in waiting mode. The network is fine - web request from the Watch using URLSession object are still working.


Here is the udp connection information after the iPhone is taken offline:


connection state turns to waiting with error "POSIXErrorCode: Network is down"

connection info: Optional([C2 server.domain.com:port udp, indefinite, prefer companion, path unsatisfied (Path was denied by NECP policy), interface: en0, ipv4])


What am I missing. Is there a permission I have to set?


See below the info.plist for the Watch extension:

has you solved this issue? i wanna devlop an watch app of tcp connect funtions, but i am not sure if watch app support tcp connect?can you help me?

Error when sending UDP packets on WatchOS 6
 
 
Q