getEncryptLocalKeyWithData(params: Object)

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

const { getEncryptLocalKeyWithData } = device;

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

Description

Get the encrypted device localKey, used for special encryption during BLE(thing) big-data channel transfers

Parameters

PropertyTypeRequiredDescription
deviceIdstringYesBig-data channel encryption calculation structure deviceId Device ID
keyDeviceIdstringYeskeyDeviceId Device ID of the device whose encryption key needs to be transferred
complete() => voidNoCompletion callback (executed on both success and failure)
NoCallback 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.getEncryptLocalKeyWithData({
  deviceId: "xx",
  keyDeviceId: "xx",
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});