authorizeStatus(params: Object)

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

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

Description

Query permission status

Parameters

PropertyTypeRequiredDefaultDescription
scope"scope.bluetooth" | "scope.record" | "scope.writePhotosAlbum" | "scope.camera" | "scope.userLocation" | "scope.userPreciseLocation" | "scope.userLocationBackground" | "scope.userInfo" | "scope.calendar" | "scope.nearByWifiDevice"No'scope.writePhotosAlbum'scope permission name
complete() => voidNo-Completion callback (executed on both success and failure)
success() => voidNo-Callback on successful API call
fail(params: Object) => voidNo-Failure callback
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Valid Values

scope
ValueDescriptionBaseKit Since
scope.bluetoothBluetooth permissionv3.17.4
scope.recordMicrophone permissionv3.17.4
scope.writePhotosAlbumWrite permissionv3.17.4
scope.cameraCamera permissionv3.17.4
scope.userLocationLow-accuracy location permissionv3.17.4
scope.userPreciseLocationHigh-accuracy location permissionv3.17.4
scope.userLocationBackgroundBackground location permission Note: On iOS, enable TARGETS->Capabilities->Background Modes->Location updatesv3.17.4
scope.userInfoUser informationv3.17.4
scope.calendarCalendar read/write permissionv3.32.13
scope.nearByWifiDeviceConnect to nearby Wi-Fi devices, Android onlyv3.32.13

Examples

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

authorizeStatus({
  scope: "scope.writePhotosAlbum",
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});