Skip to main content

BluetoothRuntimeProvider

BluetoothRuntimeProvider supplies a BluetoothRuntime object to Bluetooth runtime hooks. It is a low-level context primitive; application flows should normally use BTProvider, which also handles permissions, manager creation, scanning, event wiring, and teardown.

Import it from @ovok/native/bt-management.

import {
BluetoothRuntimeProvider,
createBluetoothRuntime,
} from "@ovok/native/bt-management";

const runtime = createBluetoothRuntime(bleManager);

<BluetoothRuntimeProvider runtime={runtime}>
<AdvancedBluetoothSurface />
</BluetoothRuntimeProvider>;

Props​

PropPurpose
runtimeA runtime created by createBluetoothRuntime or a compatible BluetoothRuntime implementation.
childrenComponents that use Bluetooth runtime hooks.

This provider does not request permissions, create a BTManager, start scanning, or destroy a manager. Those are responsibilities of BTProvider. If you compose a runtime manually, you must set its manager, forward discovery/status/result/connection events, and clean up the manager yourself.

useBluetoothRuntime throws when a hook renders outside a runtime provider. Prefer focused hooks such as useNearbyDevices and useMeasurements unless the integration needs the lower-level event API.

See BTProvider and Bluetooth hooks.