Check if iPhone is paired with apple watch?

断了今生、忘了曾经 提交于 2019-12-03 02:01:01

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

The best you can do is write to a shared NSUserDefaults value the first time the user opens your WK app, then check for that value in your iOS app. Beyond that there's no info you can get.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!