handleShortcut(params: Object)

Requires:
BizKit≥3.1.1@ray-js/ray≥0.8.0
Platforms:
iOSAndroid
import { handleShortcut } from '@ray-js/ray';

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

Description

Manage shortcuts, including add and remove, iOS only

Parameters

PropertyTypeRequiredDescription
typenumberYesOperation type: 0-add, 1-remove
sceneIdstringYesScene ID
namestringYesScene name
iconUrlstringNoScene logo
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
PropertyTypeDescriptionBizKit Since
operationStepnumberOperation step: 0-add, 1-remove, 2-update, 3-cancelv3.1.2
operationStatusbooleanOperation status: YES for success; NO for failurev3.1.2
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

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

handleShortcut({
  type: 1,
  sceneId: "xx",
  name: "xx",
  iconUrl: "xx",
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});