Contents

Nearby Interaction

Locate and interact with nearby devices using identifiers, distance, and direction.

Overview

Use Nearby Interaction in your app to acquire the position of devices with an Ultra Wideband (UWB) chip, such as iPhone 11 or later, Apple Watch, and third-party accessories. To participate in an interaction, devices in physical proximity run an app and share their position and device tokens that uniquely identify them. When the app runs in the foreground, Nearby Interaction notifies the interaction session of the peer’s location by reporting the peer’s direction and distance in meters.

Apple devices use the high-frequency capabilities of the UWB chip to share their positions in the physical environment and enable fluid, interactive sessions. For example:

  • A multiuser AR experience that places virtual water balloons in the hands of its participants

  • A taxi or rideshare app that employs a peer user’s direction in real time to identify the relative locations of a driver and a customer

  • A game app that enables a user to control a paddle with their device and respond to a moving ball on the peer user’s screen, as in the following figure

[Image]

For guidance on designing nearby interactions, see the Human Interface Guidelines > Nearby interactions.

Interact with Apple Watch

The UWB chip-capable Apple Watch running watchOS 8 supports Nearby Interaction sessions. Apps share discovery tokens to begin an interaction session in watchOS using a custom server, Core Bluetooth, LAN (TCP/UDP), or Watch Connectivity.

Nearby Interaction in iOS provides a peer device’s distance and direction, whereas Nearby Interaction in watchOS provides only a peer device’s distance.

Interact with third-party devices

In iOS 15 and later and watchOS 8 and later, UWB-enabled devices can interact with third-party accessories you partner with or develop using the Nearby Interaction Accessory Protocol Specification. To begin an interaction session with a third-party accessory, establish a data link with the accessory, receive its configuration data, and create an NINearbyAccessoryConfiguration. The framework provides configuration data for your device through session(_:didGenerateShareableConfigurationData:for:) that your app sends to the accessory to begin detecting the accessory’s range. For more information on accessory interaction, see NINearbyAccessoryConfiguration.

Using Nearby Interaction in the background

While your app is in the foreground, it can freely use Nearby Interaction to range with a peer device or third-party accessory. When the app moves to the background, it can continue ranging only if the peer or accessory is Bluetooth Low Energy (LE)-paired and connected.

In iOS 18.4 and later, your app can continue ranging in the background with any supported peer or accessory if the app starts a Live Activity as it goes to the background. For more information about creating Live Activities, see ActivityKit.

In iOS 27.2 and later, DL-TDOA sessions can begin when the system relaunches your app in the background. For example, if your app uses iBeacon region monitoring and DL-TDOA together to locate a device in the physical environment, you can start the DL-TDOA session immediately in the iBeacon region-entry callback. For more information, see Downlink time difference of arrival ranging.

Setup

Authorization

Phone interaction

Watch interaction

Third-party accessories

Periodic updates

Camera assistance

DL-TDOA ranging

Errors

Deprecated

Avoid using deprecated configuration in your apps.

Topics

Articles

Classes

Protocols

Structures

Variables