getSystemSetting(params: Object)

Requires:
BaseKit≥2.5.0@ray-js/ray≥0.5.9
Platforms:
iOSAndroid
import { getSystemSetting } from '@ray-js/ray';

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

Description

Get device settings

Parameters

PropertyTypeRequiredDescription
complete() => voidNoCompletion callback (executed on both success and failure)
success(params: Object) => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
success callback parameters
PropertyTypeDescriptionBaseKit Since
bluetoothEnabledbooleanSystem Bluetooth switch, default falsev3.2.6
locationEnabledbooleanSystem location switch, default falsev3.2.6
wifiEnabledbooleanSystem Wi‑Fi switch, default falsev3.2.6
deviceOrientationstringDevice orientation, default is portrait Portrait = "portrait", landscape = "landscape"v3.2.6
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

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

getSystemSetting({
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});