Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to detect if an Apple Watch is paired with an iPhone?

I want to know if there's an API available that shows the availability of an Apple Watch. I don't want to write an Apple Watch App yet. I want to do some analysis to see what percentage of actual users have an Apple Watch, before investing time to develop a watch version (if possible, of course).

like image 726
stonycis Avatar asked Sep 16 '25 19:09

stonycis


2 Answers

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 :)

like image 80
BilalReffas Avatar answered Sep 19 '25 10:09

BilalReffas


The answer is yes but you have to support watchOS 2 and iOS9 to do it. You need to check the property pairedfrom WCSession class.

You can find all the information at Watch Connectivity Framework Reference. I also recommend to watch this video from WWDC 2015 and read this tutorial

like image 36
agy Avatar answered Sep 19 '25 09:09

agy