Skip to main content

BluetoothPlugin.requestAndConnectDevice()

BFChainPluginBluetoothPluginrequestAndConnectDeviceLess than 1 minute

Requests and connects to a Bluetooth device. This must be called after BluetoothPlugin.open() and before BluetoothPlugin.close().

BluetoothPlugin.requestAndConnectDevice(options)

Parameters

Returns

Example

import { bluetoothPlugin } from "@plaoc/plugins";

bluetoothPlugin  
.open()
.then(res => {
  if(res.success) {
    const options = {
      acceptAllDevices: true, 
      optionalServices: ["00003802-0000-1000-8000-00805f9b34fb"],
    };
    return bluetoothPlugin.requestAndConnectDevice(options);
  }
})
.then(res => {
  if(res.success) {
    // Successfully requested and connected to a Bluetooth device
  }
});

Platform Compatibility

Property/Method/EventAndroidiOSDesktop-DevDesktop
requestAndConnectDeviceX

See Also

BluetoothPlugin

Comments
  • Latest
  • Oldest
  • Hottest
Powered by Waline v2.15.7