Search code examples
iosswiftwatchkitapple-watch

Check internet connection in Apple Watch


I am making application for apple watch.I need to check for internet connection in WatchKit. Can anyone please tell me How can I check for internet connection in WatchKit application?

Thanks in advance!!!


Solution

  • You can use WatchConnectivity framework and then communicate with iOS to check whether the internet is available or not.

    Another way is you can use URLSession in watch and check if you can get the data then you are connected to the internet.

    The better approach would be with an iOS device. Use Reachability, in iOS and send an appropriate flag to WatchOS and make it Observable so it can know when the Internet is available.