2

How can I determine the reachability in watchOS2?

If I import reachability.h, Xcode doesn't find the SystemConfiguration.h framework.

Pang
  • 9,564
  • 146
  • 81
  • 122
Kotik_o
  • 295
  • 6
  • 19

1 Answers1

4

Looks like Apple removed SystemConfiguration from the list of watchOS supported system frameworks: https://developer.apple.com/library/prerelease/watchos/documentation/General/Conceptual/AppleWatch2TransitionGuide/LeverageSystemTechnologies.html

It use to be there at the time of the WWDC Keynote announcement however I could not see the framework in early betas (there was also an empty API documentation page in the prerelease library) however they appear to have updated the site and removed it from the list.

I can only assume that this means you won't be able to detect the watches reachability status what is a pain because NSNetServiceBrowser doesn't appear to work while my watch is connected to my phone (as the WiFi chip is powered down and network requests are handled over BLE via the phone instead).

liamnichols
  • 12,419
  • 2
  • 43
  • 62
  • We will have to wait an updated from Apple. I have read that WatchOS connects to the same Wi-Fi where iphone has been connected before. It's true? – Kotik_o Aug 08 '15 at 11:33
  • From my tests, this is indeed true however from what I can tell, to save power it won't use WiFi on the watch itself unless it actually needs to (The bluetooth connection to the phone is a lot more energy efficient so if the watch is connected via bluetooth already then it won't bother firing the WiFi chip up) – liamnichols Aug 10 '15 at 08:02
  • Yes, you are right. But, if I want to receive a UDP broadcast from the Wi-Fi, I want to know if the Apple watch is connected via bluetooth or Wi-Fi. So, Apple, how the developers know this? – Kotik_o Aug 12 '15 at 15:26
  • Yeah.. I've got a forum post on the Apple Dev Forums here: https://forums.developer.apple.com/thread/13988 and i've also filed a bug report about it (https://openradar.appspot.com/radar?id=5490630826393600)... My expectation is that it should work similar to NSURLSession where if the watch was paired with an iPhone, it should instead use the iPhone's WiFi instead and then transfer anything between the watch and phone over Bluetooth. I've implemented something like this myself using `WCSession` and it kinda works but I think this should be done by the core os. – liamnichols Aug 13 '15 at 08:09