How to check whether iPhone and apple watch are connected How to check whether iPhone and apple watch are connected ios ios

How to check whether iPhone and apple watch are connected


So on WatchOS 2 that is possible !

You have to do on iPhone side :

First :

import WatchConnectivity

Then :

   if WCSession.isSupported() { // check if the device support to handle an Apple Watch        let session = WCSession.defaultSession()        session.delegate = self        session.activateSession() // activate the session        if session.paired { // Check if the iPhone is paired with the Apple Watch                // Do stuff        }    }

I hope It would help you :)


With watchOS 2.0 you can. To do this you would add these to your ExtensionDelegate if you wanted your Apple Watch to get a notification:

func watchKitSetup() {        if (WCSession.isSupported()) {        let session = WCSession.defaultSession()        session.delegate = self        session.activateSession()        // In your WatchKit extension, the value of this property is true when the paired iPhone is reachable via Bluetooth.        // On iOS, the value is true when the paired Apple Watch is reachable via Bluetooth and the associated Watch app is running in the foreground.        // In all other cases, the value is false.        if session.reachable {        }    }}func applicationDidFinishLaunching () {    self.watchKitSetup()}// Called when session.reachable value changes, such as when a user wearing an Apple Watch gets out of range of their iPhone.func sessionReachabilityDidChange(session: WCSession) {    if session.reachable {    }}

You should also add WCSessionDelegate to your ExtensionDelegate.


From a formal perspective, Apple have not given any indication of how this will be handled.

However, given the pairing and communication area handled by the OS without app involvement, it seems almost certain that any notifications to the user regarding connection issues on the watch (and at the phone end) will be handled by the Watch OS as well. My guess would be that a user will be given an opportunity to resolve the loss of connectivity, or to quit the Watch app if they cannot. From a developer perspective, it is highly likely our apps will not be able to distinguish between an unresolved loss of connectivity and the user quitting an app normally, with the same notification being sent to the Watch Extension for either, but this is only a guess.

It should be noted that there is no third party developer code running on the watch for the current Watch apps, just a UI, so even an unresolved loss of connection will not result in any data loss. If the Watch Extension (which runs on the iPhone) is quit by the OS due to loss of connection to the watch, it will still be able to do its usual data storage and cleanup.