如何获取 iPhone 和配对的 Apple Watch 之间的当前距离 [英] how to get current distance between iPhone and paired Apple Watch

查看:31
本文介绍了如何获取 iPhone 和配对的 Apple Watch 之间的当前距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法可以让苹果手表和配对的iPhone之间保持距离.我正在开发一个测试用例,当两个设备之间的距离发生变化时,应该通知 iPhone 和 Apple Watch.

is there any way to get distance between apple watch and paired iPhone. I am working on a test case in which .. iPhone and Apple Watch should be notified when distance between both devices got change.

推荐答案

从技术上讲,您无法获得准确的距离,但您可以让一台设备充当信标并在其核心位置附近工作.您最多可以通过三种接近状态来检查距离:CLProximityImmediate(即设备彼此非常接近)、CLProximityNear(即设备靠近彼此)和 CLProximityFar(即设备即将失去蓝牙连接).

You technically can't get the exact distance, but you can make one device act as a beacon and work on their Core Location proximity. You have up to three proximity states on which you can check the distance: CLProximityImmediate (i.e. the device are very close to each other), CLProximityNear (i.e. the devices are close to each other) and CLProximityFar (i.e. the devices are about to lose Bluetooth connection).

这篇关于如何获取 iPhone 和配对的 Apple Watch 之间的当前距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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