harmony 鸿蒙ShortcutInfo (System API)

  • 2025-06-12
  • 浏览 (5)

ShortcutInfo (System API)

The ShortcutInfo module defines shortcut information configured in the configuration file. The information can be obtained through getShortcutInfo.

NOTE

The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.

For the FA model, the shortcut information is configured in the config.json file. For details about the shortcut information in the stage model, see shortcuts.

The APIs provided by this module are system APIs.

ShortcutWant

System capability: SystemCapability.BundleManager.BundleFramework.Launcher

System API: This is a system API.

Name Type Read-Only Optional Description
targetBundle string Yes No Target bundle name of the shortcut.
targetModule string Yes Yes Target module name of the shortcut.
targetAbility string Yes No Target ability name of the shortcut.
parameters12+ Array<ParameterItem> No Yes Custom data in the shortcut configuration.

ShortcutInfo

System capability: SystemCapability.BundleManager.BundleFramework.Launcher

System API: This is a system API.

Name Type Read-Only Optional Description
id string Yes No ID of the application to which the shortcut belongs.
bundleName string Yes No Name of the bundle that contains the shortcut.
moduleName string Yes Yes Module name of the shortcut.
hostAbility string Yes Yes Local ability name of the shortcut.
icon string Yes Yes Icon of the shortcut.
iconId number Yes Yes ID of the shortcut icon.
label string Yes Yes Label of the shortcut.
labelId number Yes Yes ID of the shortcut label.
wants Array<ShortcutWant> Yes Yes Want information required for the shortcut.
appIndex12+ number No No Index of an application clone.
sourceType12+ number No No Shortcut source type. The value 0 means a custom shortcut, and 1 means a static shortcut.

ParameterItem12+

Describes the custom data in the shortcut configuration.

System capability: SystemCapability.BundleManager.BundleFramework.Launcher

Name Type Read-Only Optional Description
key string No No Key of the custom data.
value string No No Value of the custom data.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Ability Kit

harmony 鸿蒙AbilityAccessControl

harmony 鸿蒙AbilityBase

harmony 鸿蒙AbilityBase_Element

harmony 鸿蒙AbilityRuntime

harmony 鸿蒙bundle

harmony 鸿蒙OH_NativeBundle_ApplicationInfo

harmony 鸿蒙OH_NativeBundle_ElementName

harmony 鸿蒙ability_access_control.h

harmony 鸿蒙ability_base_common.h

0  赞