• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# @ohos.distributedBundle (Distributed Bundle Management)
2
3The **distributedBundle** module manages distributed bundles.
4
5> **NOTE**
6>
7> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8
9## Modules to Import
10
11```
12import distributedBundle from '@ohos.distributedBundle';
13```
14
15## System Capability
16
17SystemCapability.BundleManager.DistributedBundleFramework
18
19## Required Permissions
20
21| Permission                                      | Permission Level    | Description              |
22| ------------------------------------------ | ------------ | ------------------ |
23| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED | system_basic | Permission to query information about all applications.|
24
25For details, see [Permission Levels](../../security/accesstoken-overview.md#permission-levels).
26
27## distributedBundle.getRemoteAbilityInfo<sup>deprecated<sup>
28
29> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager)](js-apis-distributedBundleManager.md) instead.
30
31getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback&lt;RemoteAbilityInfo&gt;): void;
32
33Obtains information about the remote ability that matches the given element name. This API uses an asynchronous callback to return the result.
34
35**Required permissions**
36
37ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
38
39**System capability**
40
41SystemCapability.BundleManager.DistributedBundleFramework
42
43**System API**
44
45This is a system API and cannot be called by third-party applications.
46
47**Parameters**
48
49| Name     | Type                                                        | Mandatory| Description                                              |
50| ----------- | ------------------------------------------------------------ | ---- | -------------------------------------------------- |
51| elementName | [ElementName](js-apis-bundle-ElementName.md)                 | Yes  | **ElementName**.                           |
52| callback    | AsyncCallback<[RemoteAbilityInfo](js-apis-bundle-remoteAbilityInfo.md)> | Yes  | Callback used to return the remote ability information.|
53
54
55
56## distributedBundle.getRemoteAbilityInfo<sup>deprecated<sup>
57
58> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager)](js-apis-distributedBundleManager.md) instead.
59
60getRemoteAbilityInfo(elementName: ElementName): Promise&lt;RemoteAbilityInfo&gt;
61
62Obtains information about the remote ability that matches the given element name. This API uses a promise to return the result.
63
64**Required permissions**
65
66ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
67
68**System capability**
69
70SystemCapability.BundleManager.DistributedBundleFramework
71
72**System API**
73
74This is a system API and cannot be called by third-party applications.
75
76**Parameters**
77
78| Name     | Type                                        | Mandatory| Description                   |
79| ----------- | -------------------------------------------- | ---- | ----------------------- |
80| elementName | [ElementName](js-apis-bundle-ElementName.md) | Yes  | **ElementName**.|
81
82**Return value**
83
84| Type                                                        | Description                             |
85| ------------------------------------------------------------ | --------------------------------- |
86| Promise\<[RemoteAbilityInfo](js-apis-bundle-remoteAbilityInfo.md)> | Promise used to return the remote ability information.|
87
88## distributedBundle.getRemoteAbilityInfos<sup>deprecated<sup>
89
90> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager)](js-apis-distributedBundleManager.md) instead.
91
92getRemoteAbilityInfos(elementNames: Array&lt;ElementName&gt;, callback: AsyncCallback&lt;Array&lt;RemoteAbilityInfo&gt;&gt;): void;
93
94Obtains information about remote abilities that match the given element names. This API uses an asynchronous callback to return the result.
95
96**Required permissions**
97
98ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
99
100**System capability**
101
102SystemCapability.BundleManager.DistributedBundleFramework
103
104**System API**
105
106This is a system API and cannot be called by third-party applications.
107
108**Parameters**
109
110| Name      | Type                                                        | Mandatory| Description                                              |
111| ------------ | ------------------------------------------------------------ | ---- | -------------------------------------------------- |
112| elementNames | Array<[ElementName](js-apis-bundle-ElementName.md)>          | Yes  | **ElementName** array, whose maximum length is 10.                  |
113| callback     | AsyncCallback< Array<[RemoteAbilityInfo](js-apis-bundle-remoteAbilityInfo.md)>> | Yes  | Callback used to return an array of the remote ability information.|
114
115
116
117## distributedBundle.getRemoteAbilityInfos<sup>deprecated<sup>
118
119> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager)](js-apis-distributedBundleManager.md) instead.
120
121getRemoteAbilityInfos(elementNames: Array&lt;ElementName&gt;): Promise&lt;Array&lt;RemoteAbilityInfo&gt;&gt;
122
123Obtains information about remote abilities that match the given element names. This API uses a promise to return the result.
124
125**Required permissions**
126
127ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
128
129**System capability**
130
131SystemCapability.BundleManager.DistributedBundleFramework
132
133**System API**
134
135This is a system API and cannot be called by third-party applications.
136
137**Parameters**
138
139| Name     | Type                                               | Mandatory| Description                 |
140| ------------ | --------------------------------------------------- | ---- | ----------------------- |
141| elementNames | Array<[ElementName](js-apis-bundle-ElementName.md)> | Yes  | **ElementName** array, whose maximum length is 10.|
142
143**Return value**
144
145| Type                                                        | Description                             |
146| ------------------------------------------------------------ | --------------------------------- |
147| Promise\<Array<[RemoteAbilityInfo](js-apis-bundle-remoteAbilityInfo.md)>> | Promise used to return an array of the remote ability information.|
148