Configuring WebSocket API for watchOS App

Hi all,

I’m developing a watchOS app that uses a WebSocket API to process voice audio. However, I keep encountering this error when trying to establish the connection:

nw_endpoint_flow_failed_with_error [C1 <server URL>:443 failed parent-flow (unsatisfied (Path was denied by NECP policy), interface: ipsec2, ipv4, ipv6, proxy)] already failing, returning

I’ve read Technical Note TN3135, which outlines an exception for audio streaming apps. My app is an audio streaming app, and I’ve already added background audio mode to the app’s capabilities. However, I’m not sure what else is required to meet the exception described in TN3135.

Questions

  1. How do I meet the exception outlined in TN3135 for WebSocket audio streaming on watchOS?
  2. Does NECP enforce additional restrictions even with background audio enabled, and how can I address this?

Any guidance or examples of implementing WebSocket audio streaming on watchOS would be greatly appreciated.

Thanks!

TN3135 links to WWDC 2019 Session 716 Streaming Audio on watchOS 6, which is where I go when I want to learn about this stuff.

Share and Enjoy

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

Hey folks! Another watchOS/iOS engineer here

I'm working on a similar use case for an audio streaming and transcribing use case for the Apple Watch.

I've worked through TN3135 as well as WWDC 2019 Session 716 and have the following elements requested turned on

  1. I have an audio background mode set up

  2. I set up the web socket after setting an AudioSession to active

  3. I set request.networkServiceType to .avStreaming

  4. my use case is squarely a audioStreaming use case

I still run into a network error where it says "The Internet connection appears to be offline"

This all said – it seems that there are watch only apps that have figured out how to use web sockets so it seems as though I'm missing something.

https://apps.apple.com/us/app/iris-voicegpt-for-apple-watch/id6737017937

Are there other settings that need to be turned on for this to work?

Configuring WebSocket API for watchOS App
 
 
Q