ASCF is a framework for HarmonyOS atomic service development. It depends on the ASCF runtime to load resource files compiled from ASCF source code and run atomic service projects.
The global object of ASCF APIs is defined as Harmony Atomic Service (HAS).
File types of ASCF source code
Framework differences
Package splitting is supported. Each package cannot exceed 2 MB, and the total package size cannot exceed 10 MB. When necessary, you can apply for larger package size. As the tabbar page must be stored in the main package, it is necessary to modify the package splitting logic of the atomic service projects converted from mini programs.
As restricted by the template, atomic services are centered on the tablet screen by default and there is no option to enforce portrait mode. Subsequent improvement has been planned.
The return value of constructor of an array in hjs is not a character string but a function. Special processing is recommended.
In API version 12, when setting the globalStyle field for the navigation bar title, if you set navigationBarTextStyle to white, the title is in black. This is because white is not supported by the system navigation bar. You can change the value of navigationStyle to custom in the app.json file to enable the custom navigation bar.
Currently, custom components do not support the getPageId method.
Components that depend on plugin capabilities, such as functional-page-navigator, channel-live, channel-video, live-player, live-pusher, and voip-room, are not supported.
For a component, the HXML file may contain multiple slots, and there is no need to declare "multipleSlots: true" in the corresponding JS file.
Principles
APIs that have been deprecated by the mini program platform are not supported.
If any mini program APIs are not supported by ASCF, send your request to the following email address. Huawei operations personnel will contact you within 1 to 3 working days.
Email address: atomicservice@huawei.com
Email subject: [Request for ASCF APIs]-[Atomic service name]-[App ID]-[Developer ID] (For details about how to query the app ID, see the following table.)
Email content: Describe your request in detail.
| Basic Information | Description |
|---|---|
| Atomic service name | Name of the atomic service on AppGallery. |
| App ID | App ID. You can find it by signing in to HUAWEI Developers and choosing My Projects > Settings > Regular > App > APP ID. |
| Developer ID | HUAWEI ID used by you for debugging. To obtain the HUAWEI ID, sign in to HUAWEI Developers and choose My Projects > Settings > Regular > Developer > Developer ID. |
Key API differences
| API | Suggestion |
|---|---|
| has.getAccountInfoSync | App ID can be obtained from AppScope or the bundle name in app.json5. |
| has.getClipboardData | This API is not supported currently due to the strict control over the clipboard permission. |