BluetoothStateNotice
BluetoothStateNotice observes Bluetooth radio and permission state. It renders a
themed card when Bluetooth is unavailable and returns no UI while the radio is on.
It does not scan or establish a Bluetooth session.
import { BluetoothStateNotice } from "@ovok/native/ui";
<BluetoothStateNotice
bleManager={bleManager}
onOpenSettings={() => navigation.navigate("BluetoothSettings")}
/>
Pass the app's long-lived BleManager so the notice observes the same radio state as
the Bluetooth feature. Without a manager, the state is unsupported.
States and actions
| State | Default behavior |
|---|---|
on | Render nothing. |
unauthorized | Show an access button; the default action requests Bluetooth permission. |
off | Show an action that opens Bluetooth settings. |
unsupported | Explain that Bluetooth LE is unavailable; no action button. |
The default permission request uses react-native-permissions. Provide
requestPermission to use app-specific permission logic. Provide onOpenSettings to
own the settings action; otherwise, the component opens Bluetooth settings through
the platform link.
Props
| Prop | Type | Description |
|---|---|---|
bleManager | BleManager | Optional manager whose radio state is observed. |
requestPermission | () => Promise<boolean> | Replace the default Bluetooth permission request. |
onOpenSettings | () => void | Promise<void> | Replace the default system settings action. |
title | string | Override the default heading. |
copy | Partial record by state | Override the heading, body, or action label for on, unsupported, unauthorized, and off. |
settingsAction | string | Set the action label and make the button open settings directly. |
testID | string | Identifier forwarded to the card. |
theme, slots | OvokUiProps | Shared theme and Button, Card, or Text overrides. |
settingsAction is useful when the app needs to send users to its own Bluetooth
settings route; when it is set, the button opens settings even in the
unauthorized state instead of requesting permission. A rejected permission or
settings action is shown as an inline error.
Use BTProvider for permissions, scanning, and
device lifecycle. See the Bluetooth guide for the full
integration.