setQuickEntryEnabled(params: Object)

Requires:
WearKit≥2.1.0@ray-js/ray≥1.7.82
Platforms:
iOSAndroid
import { wear } from '@ray-js/ray';

const { setQuickEntryEnabled } = wear;

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

Description

Enable or disable quick entry component by type and component ID.

Parameters

PropertyTypeRequiredDescription
typenumberYesEntry type (int): Android starts with 1: 101=Component/102=Shortcut icon/103=Tile; iOS starts with 2: 201=Component/202=Shortcut icon/203=Tile
componentIdnumberYesComponent ID (int): Android starts with 1 (1xxx), iOS starts with 2 (2xxx)
enablednumberYesOn/off status (int): 0=off, 1=on
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

Error Code

Error CodeError Message
10001Internal error

Examples

Basic usage

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

wear.setQuickEntryEnabled({
  type: 0,
  componentId: 0,
  enabled: 1,
  success: () => {
    console.log('setQuickEntryEnabled success');
  },
  fail: error => {
    console.error(error);
  },
});