Search code examples
ioswatchkitapple-watch

Check if iPhone is paired with apple watch?


In my app,

I need to find if my phone is paired with a apple watch and get some information about the paired watch like its name. I tried reading the documentation but I couldn't seem to find any thing specific to my use case.

Any help is appreciated.


Solution

  • So since 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.default()
            session.delegate = self
            session.activate() // activate the session
    
            if session.isPaired { // Check if the iPhone is paired with the Apple Watch
                    // Do stuff
            }
        }
    

    I hope It would help you :)