检查iPhone是否与苹果手表配对? [英] Check if iPhone is paired with apple watch?

查看:358
本文介绍了检查iPhone是否与苹果手表配对?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用中,

我需要查看我的手机是否与苹果手表配对,并获得有关配对手表的一些信息,如其名称。我尝试阅读文档,但我似乎找不到任何特定于我的用例的东西。

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.

任何帮助表示赞赏。

推荐答案

所以自从WatchOS 2有可能!

So since WatchOS 2 that is possible !

你必须在iPhone方面做:

You have to do on iPhone side :

首先:

import WatchConnectivity

然后:

   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
        }
    }

我希望它会帮助你:)

这篇关于检查iPhone是否与苹果手表配对?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆