resetFactory(params: Object)

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

const { resetFactory } = device;

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

Description

Reset the device to factory settings. Device data will be cleared and it will enter an awaiting provisioning state.

Parameters

PropertyTypeRequiredDescription
deviceIdstringYesdeviceId device ID Supports fetching other devices’ information across panels; the current panel can pass the current device’s ID to retrieve it
Nodps
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.resetFactory({
  deviceId: "xx",
  dps: { "xx": {} },
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});