---
title: Nearby Interaction
framework: Nearby Interaction
role: collection
role_heading: Framework
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, watchOS 8.0+]
path: nearbyinteraction
---

# Nearby Interaction

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

## Overview

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

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. note: The supportsPreciseDistanceMeasurement function returns false in Mac apps built with Mac Catalyst. For a compatible iPad or iPhone app running in visionOS, framework features are unavailable, and any calls you make to the framework APIs have no effect. 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. note: Enable a capability in Xcode for the  type of background activity your app uses. In your target’s Signing & Capabilities tab, add the Background Modes capability, then select Uses Nearby Interaction. Setup Initiating and maintaining a session NISession Authorization NSNearbyInteractionUsageDescription Phone interaction Implementing interactions between users in close proximity Discovering peers with Multipeer Connectivity Extending advanced direction finding and ranging NINearbyPeerConfiguration Watch interaction Implementing proximity-based interactions between a phone and watch Third-party accessories Implementing spatial interactions with third-party accessories NINearbyAccessoryConfiguration NIMotionActivityState Periodic updates NINearbyObject NISessionDelegate Camera assistance Finding devices with precision NIAlgorithmConvergence NIAlgorithmConvergenceStatus NIAlgorithmConvergenceStatus Algorithm Convergence Status DL-TDOA ranging Downlink time difference of arrival ranging Errors NIError NIError.Code NIErrorDomain Deprecated Avoid using deprecated configuration in your apps. NSNearbyInteractionAllowOnceUsageDescription

## Topics

### Articles

- [Algorithm Convergence Status](nearbyinteraction/algorithm-convergence-status.md)
- [Discovering peers with Multipeer Connectivity](nearbyinteraction/discovering-peers-with-multipeer-connectivity.md)
- [Downlink time difference of arrival ranging](nearbyinteraction/dl-tdoa-ranging.md)
- [Extending advanced direction finding and ranging](nearbyinteraction/extending-advanced-direction-finding-and-ranging.md)
- [Finding devices with precision](nearbyinteraction/finding-devices-with-precision.md)
- [Implementing interactions between users in close proximity](nearbyinteraction/implementing-interactions-between-users-in-close-proximity.md)
- [Implementing proximity-based interactions between a phone and watch](nearbyinteraction/implementing-proximity-based-interactions-between-a-phone-and-watch.md)
- [Implementing spatial interactions with third-party accessories](nearbyinteraction/implementing-spatial-interactions-with-third-party-accessories.md)
- [Initiating and maintaining a session](nearbyinteraction/initiating-and-maintaining-a-session.md)

### Classes

- [NIAlgorithmConvergence](nearbyinteraction/nialgorithmconvergence.md)
- [NINearbyAccessoryConfiguration](nearbyinteraction/ninearbyaccessoryconfiguration.md)
- [NINearbyObject](nearbyinteraction/ninearbyobject.md)
- [NINearbyPeerConfiguration](nearbyinteraction/ninearbypeerconfiguration.md)
- [NISession](nearbyinteraction/nisession.md)

### Protocols

- [NISessionDelegate](nearbyinteraction/nisessiondelegate.md)

### Structures

- [NIError](nearbyinteraction/nierror.md)

### Variables

- [NIErrorDomain](nearbyinteraction/nierrordomain.md)
