Skip to content

BluetoothStatus.state is always false #55

@gpawlik

Description

@gpawlik

No matter if the Bluetooth is switched on or off (both general settings and app settings) the state comes as false. Am I missing something?

import { BluetoothStatus } from 'react-native-bluetooth-status';
...
async checkBluetoothState() {
    const isEnabled = await BluetoothStatus.state();
    // false
}

When I inspect the state in the line https://github.com/solinor/react-native-bluetooth-status/blob/master/index.js#L28

this.subscription = bluetoothEvent.addListener(BT_STATUS_EVENT, state => {

state is undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions