Taro.onBluetoothAdapterStateChange(callback)
Listens on the Bluetooth adapter status change event.
Type
(callback: Callback) => void
Parameters
Callback
The callback function for the Bluetooth adapter status change event.
(result: CallbackResult) => void
Property | Type |
---|---|
result | CallbackResult |
CallbackResult
Property | Type | Description |
---|---|---|
available | boolean | Indicates whether the Bluetooth adapter is available |
discovering | boolean | Indicates whether the Bluetooth adapter is in the discovery status |
Sample Code
Taro.onBluetoothAdapterStateChange(function (res) {
console.log('adapterState changed, now is', res)
})
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
Taro.onBluetoothAdapterStateChange | ✔️ |