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

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

问题描述

有什么方法可以使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天全站免登陆