GuidesComponents

Bluetooth management

Public Bluetooth runtime, provider, hooks, device definitions, and UI entry points.

  • Stable unknown
  • Release candidate since 1.16.1-rc.3
  • Development since 1.16.1-dev.2111+9796905

The Bluetooth module is the runtime and protocol layer behind BLE discovery and measurement delivery. Its public React entry point is BTProvider; its SDK subpath is @ovok/native/bt-management.

Choose an entry point

NeedAPI
Start a BLE sessionBTProvider with a stable BleManager and an acceptedDevices tuple
Respond to discovery and readingsonDeviceFound, onDeviceStatusChanged, onConnectionEvent, onResult, and onError
Ask users to choose among discoveriesautoConnect, onDeviceSelectionRequired, and BluetoothDevicePicker
Inspect runtime state in a componentuseNearbyDevices, useDeviceConnection, useMeasurements, useScanControl, and useRuntimeEvent
Remember pairingsusePairedDevices with app-provided key-value storage
Use an SDK protocolIntegratedDevices or an entry from SUPPORTED_DEVICES
Add a new protocoldefineCustomDevice and a custom device declaration
Deliver readings while backgroundedbackgroundSync configuration and native setup

Runtime lifecycle

By default, BTProvider requests permissions on mount and starts discovery when acceptedDevices is non-empty. Set gateOnPermission to keep children from rendering until the automatic request resolves; a denied request then shows the permission fallback. Set requestPermissionOnMount={false} to keep the provider mounted but wait for an app-triggered request through useBluetoothState().requestPermission(). The manager is destroyed when the provider unmounts or its core configuration changes.

Keep both the BleManager and acceptedDevices stable. Recreating either during render can restart a session. The provider owns scanning and managed device subscriptions; application code owns the manager object, result persistence, patient association, and application-specific UI.

Component and API reference

For an end-to-end flow, start with the Bluetooth guide.

Last updated on

On this page