getSystemInfo(params: Object)

Requires:
BaseKit≥2.0.1@ray-js/ray≥0.3.23
Platforms:
iOSAndroid
import { getSystemInfo } from '@ray-js/ray';

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

Description

Get system information

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
is24HourbooleanWhether 24-hour format is usedv3.2.6
systemstringOS and versionv3.2.6
brandstringDevice brandv3.2.6
modelstringDevice modelv3.2.6
platformstringSystem type, e.g., ios, android, harmonyv3.2.6
timezoneIdstringTime zone IDv3.2.6
pixelRationumberDevice pixel ratiov3.2.6
screenWidthnumberScreen width in logical pixels, e.g., 411v3.2.6
screenHeightnumberScreen height in logical pixels, e.g., 914v3.2.6
windowWidthnumberWindow width in logical pixels, e.g., 411v3.2.6
windowHeightnumberWindow height in logical pixels, e.g., 914v3.2.6
useableWindowWidthnumberAvailable window width in logical pixels, e.g., 411v3.3.2
useableWindowHeightnumberAvailable window height in logical pixels, e.g., 814v3.3.2
statusBarHeightnumberStatus bar height in logical pixels, e.g., 34v3.2.6
languagestringCurrent languagev3.2.6
Safe area information; fields are in logical pixels, e.g., { left: 0, right: 411, top: 34, bottom: 898, width: 411, height: 864 }v3.2.6
albumAuthorizedbooleanWhether access to the photo album is allowedv3.2.6
cameraAuthorizedbooleanWhether camera access is allowedv3.2.6
locationAuthorizedbooleanWhether location access is allowedv3.2.6
microphoneAuthorizedbooleanWhether microphone access is allowedv3.2.6
notificationAuthorizedbooleanWhether sending notifications is allowedv3.2.6
notificationAlertAuthorizedbooleanWhether notification alerts are allowedv3.2.6
notificationBadgeAuthorizedbooleanWhether notification badges are allowedv3.2.6
notificationSoundAuthorizedbooleanWhether notification sounds are allowedv3.2.6
bluetoothEnabledbooleanWhether Bluetooth is enabledv3.2.6
locationEnabledbooleanWhether location services are enabledv3.2.6
wifiEnabledbooleanWhether Wi-Fi is enabledv3.2.6
theme"dark" | "light"Current themev3.2.6
deviceOrientation"portrait" | "landscape"Current screen orientationv3.2.6
deviceLevelstringDevice level (low: low - middle: middle - high: high)v3.3.3
isSupportPinShortcutbooleanWhether the phone OS supports creating shortcuts (Android only)v3.5.0
deviceTypestringDevice type phone: Phone pad: Tabletv3.10.6
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Valid Values

success.params.theme
ValueDescriptionBaseKit Since
darkDark mode-
lightLight mode-
success.params.deviceOrientation
ValueDescriptionBaseKit Since
portraitPortrait-
landscapeLandscape-

Examples

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

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