Skip to main content
Version: Next

Taro.onBluetoothAdapterStateChange(callback)

Listens on the Bluetooth adapter status change event.

Reference

Type

(callback: Callback) => void

Parameters

Callback

The callback function for the Bluetooth adapter status change event.

(result: CallbackResult) => void
PropertyType
resultCallbackResult

CallbackResult

PropertyTypeDescription
availablebooleanIndicates whether the Bluetooth adapter is available
discoveringbooleanIndicates whether the Bluetooth adapter is in the discovery status

Sample Code

Taro.onBluetoothAdapterStateChange(function (res) {
console.log('adapterState changed, now is', res)
})

API Support

APIWeChat Mini-ProgramH5React Native
Taro.onBluetoothAdapterStateChange✔️