NearbyDevicePrompt
Mount NearbyDevicePrompt inside BTProvider to offer one accepted nearby
device at a time. The prompt never connects until the person taps “Yes, pair
it”. Without mounting it, the SDK behaves as before.
import { NearbyDevicePrompt } from "@ovok/native/ui";
<NearbyDevicePrompt
storage={pairedDeviceStorage}
enabled={!pairingPageIsOpen}
hint="Hold the monitor button until the pairing symbol appears."
onPaired={(device) => analytics.track("device_paired", { id: device.id })}
/>
Not mine persists the device ID under
${storageKey}.declined-nearby-devices (or declinedStorageKey when supplied). Later
skips it for the current Bluetooth provider session without writing storage.
Devices already remembered by usePairedDevices and declined IDs are not
offered. If a connection fails, the dialog shows the same device-neutral,
Bluetooth-error-code keyed copy as PairingFlow, with a retry button. The
component is foreground UI and does not change background synchronization.
The headless useNearbyDeviceOffer hook provides the same offer, actions,
status, and typed BluetoothError without rendering UI.
| Prop | Type | Description |
|---|---|---|
storage | PairedDeviceStorage | Required persistence adapter used for remembered and declined device IDs. |
storageKey | string | Pairing key used by usePairedDevices; defaults to @ovok/native/paired-devices. |
declinedStorageKey | string | Optional key for persisted “Not mine” device IDs. |
enabled | boolean | Suppress the prompt while the app is showing its own pairing UI. Defaults to true. |
hint | string | Optional app-owned device-specific pairing instruction. |
labels | Record<string, string> | Override title, pair, notMine, later, retry, pairing, hint, and Bluetooth error-code copy. |
onPaired | (device: RuntimeDevice) => void | Called after connection and pairing storage succeed. |
onError | (error: Error, device?: RuntimeDevice) => void | Called after a connection or persistence error. |
theme, slots, testID | shared UI props | Optional theme, primitive overrides, and test ID. |
The hook is exported from @ovok/native/bt-management; the prompt is exported
from @ovok/native/ui.