connectBTBond(params: Object)

Requires:
DeviceKit≥2.4.0@ray-js/ray≥0.6.23
Platforms:
iOSAndroid
import { device } from '@ray-js/ray';

const { connectBTBond } = device;

// Promise usage
try {
  const res = await connectBTBond({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Open BT pairing window (Android only)

Parameters

PropertyTypeRequiredDescription
macstringYesDevice MAC address
complete() => voidNoCompletion callback (executed on both success and failure)
success() => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { device } from '@ray-js/ray'

device.connectBTBond({
  mac: "xx",
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});