Search code examples
iosapple-watch

how to get current distance between iPhone and paired 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.


Solution

  • 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).