Network Connection on watchOS App

I am developing a watchOS-only app, and whenever I attempt to make a network request, it always fails and throws the following error:

Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline."

I noticed that when I turn off Wi-Fi and Bluetooth in the settings of the iPhone paired with the Apple Watch (thus disconnecting the Apple Watch from the iPhone), my app can successfully connect to the network.

Additionally, when the app contains both an iOS app and a watchOS app, after granting network permissions on the iOS app, the watchOS app can access the network normally when connected to the iPhone.

When opening some system apps on the Apple Watch (such as the "Workout" app), the app will display a network permission request similar to that on iOS, but this request does not automatically pop up when my watchOS app attempts to access the network.

Is there a way to request network permissions in a watchOS-only app so that it can access the network while connected to the iPhone?

Answered by Frameworks Engineer in 794985022

Howdy! Can you please file Feedback with sysdiagnose logs attached? If you are running the watchOS 11 beta, the appropriate logs should be recorded when you initiate a sysdiagnose. If you are running watchOS 10 or earlier, you'll need to install the sysdiagnose profile first (you can find profiles & instructions for getting logs here: https://developer.apple.com/bug-reporting/profiles-and-logs/?platform=watchos). It does sound like there's something missing here, and I'd love to investigate. Thank you!

Howdy! Can you please file Feedback with sysdiagnose logs attached? If you are running the watchOS 11 beta, the appropriate logs should be recorded when you initiate a sysdiagnose. If you are running watchOS 10 or earlier, you'll need to install the sysdiagnose profile first (you can find profiles & instructions for getting logs here: https://developer.apple.com/bug-reporting/profiles-and-logs/?platform=watchos). It does sound like there's something missing here, and I'd love to investigate. Thank you!

Hello,

I found this forum thread aligns with what I am finding in one of my apps. Although I don't have a standalone watch app, the conditions described here are what my app is experiencing.

My watch ext can independently connect to internet via wifi or cellular connection only when disconnected from phone (operating independently). If watch is connected to phone via BLE but the phone is disconnected from network (no wifi or cellular data) URLSession tasks on watch fail with Code=-1009 as described in post. Why can't the watch use its local wifi connection instead of relying on connected phone?

Is network permission required in this case? I thought local network permission was only for discovery and connecting devices on local network while internet connectivity can still operate without this permission. Does granting this permission workaround the issue of watch using local network connection rather than relying on connected phone? Is there a setting I'm missing to tell watch ext to use local network connection first before trying on phone?

Any advice is appreciated.

-Brian.

Similarly to the OP, we'd need a sysdiagnose from phone and watch with logging turned on to understand what's going on.

Network Connection on watchOS App
 
 
Q