Skip to main content

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​

StateDefault behavior
onRender nothing.
unauthorizedShow an access button; the default action requests Bluetooth permission.
offShow an action that opens Bluetooth settings.
unsupportedExplain 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​

PropTypeDescription
bleManagerBleManagerOptional 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.
titlestringOverride the default heading.
copyPartial record by stateOverride the heading, body, or action label for on, unsupported, unauthorized, and off.
settingsActionstringSet the action label and make the button open settings directly.
testIDstringIdentifier forwarded to the card.
theme, slotsOvokUiPropsShared 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.