# HarmonyOS Adaptation Guide
The basic library officially supports the HarmonyOS platform from 3.7.0, and is consistent with other platforms.By updating the base library in the background shade, the developer tools can cut to version 3.7.0 in Details - Local Settings - Debugging Base Library for development debugging.
# Architecture Overview
Weixin Mini Program The [runtime environment for HarmonyOS platforms is similar to Android, where the JavaScript code for the logic layer runs in v8, and the view layer is rendered based on the HarmonyOS native ArkWeb engine, while the Skyline rendering engine is supported and not yet available.
In addition, the operation mechanism, update mechanism, component framework, etc. of Weixin Mini Program are consistent, but there will be differences in some feature support.
# How to adapt
At present, the difference between the HarmonyOS platform and other platforms is mainly the WHarmonyOSebView engine and features related to native capabilities.
The former uses the ArkWeb engine on HarmonyOS, and there may be some differences in the features that rely on WebView, such as CSS styles, which need to be compatible with the actual situation;
The latter are mostly component / interface related and can be accessed viawx.canIUseinterface or viawx.getDeviceInfo ().platform = = = 'ohos'Make necessary compatibility with business logic.
Note: To simulate HongMeng in WeChat developer tools, you need to determine wx.getDeviceInfo ().system = = 'HarmonyOS' (platform is devtools in the tool)
# Methods of debugging
- Debugging through developer tools
- Download the latest nightly version of developer tools and debug with the latest developer tools
- Debugging Base Base Version Choose 3.7.0 +
- Select "Weixin Mini Program" mode and select Huawei Hongmeng model
- Support the use of wx.canIUse to determine whether an interface is usable
- Debugging through real machine
Download the app store in HarmonyOS, and after installation, you can open Weixin Mini Program for debugging.
# Status of support
Features that are not currently supported are listed below and you need to be compatible with those that are not supported.Specific support for components / interfaces can be viewed in the corresponding documentation, and the partial support for generally means that a few higher-order functions do not support .
# frame
| Characteristic | Status of support |
|---|---|
| Skyline Rendering Engine | Support is on the way |
| Initial rendering cache | No support. |
| Dark Mode | No support. |
| Periodic Updates | No support. |
| Data prefetched | No support. |
| Accessibility | No support. |
| Sharing WeChat Moments | No support. |
# assembly
| assembly | Status of support |
|---|---|
| Accessibility | No support. |
| keyboard-accessory | No support. |
| channel-live | No support. |
| channel-video | No support. |
| voip-room | No support. |
| map | Part of Support |
| canvas | Part of Support |
| ad/ad-custom | No support. |
| official-account | No support. |
| xr-frame | No support. |
| web-view | Part of Support |
# interface
| Modular | interface | Status of support |
|---|---|---|
| Fundamentals - Life Cycle | wx.onApiCategoryChange / wx.offApiCategoryChange / wx.getApiCategory | No support. |
| Fundamentals - Application Level Events | wx.onThemeChange / wx.offThemeChange / wx.onAudioInterruptionEnd / wx.onAudioInterruptionBegin / wx.offAudioInterruptionEnd / wx.offAudioInterruptionBegin | No support. |
| Fundamentals - Performance | wx.preloadWebview / wx.preloadSkylineView | No support. |
| Routing - Custom routing | - | Support is on the way |
| Jump back | wx.openEmbeddedMiniProgram / wx.onEmbeddedMiniProgramHeightChange / wx.offEmbeddedMiniProgramHeightChange | No support. |
| Forward | wx.showShareImageMenu / wx.onCopyUrl / wx.offCopyUrl | No support. |
| Interface - Interaction | wx.enableAlertBeforeUnload / wx.disableAlertBeforeUnload | Support is on the way |
| Interface - Scroll | ScrollViewContext | No support. |
| Interface - Toping | wx.setTopBarText | No support. |
| Interface - Windows | - | No support. |
| Interface - worklet animation | - | Support is on the way |
| Pay | wx.requestCommonPayment / wx.requestVirtualPayment / wx.openHKOfflinePayView | No support. |
| Data Caching - Data Pull-Up and Periodic Updates | wx.getBackgroundFetchData / wx.onBackgroundFetchData / wx.setBackgroundFetchToken / wx.getBackgroundFetchToken | No support. |
| Data Cache - Cache Manager | - | No support. |
| canvas | - | Part of Support |
| Media - Videos | wx.openVideoEditor | No support. |
| Media - Audio | WebAudio only supported | No support. |
| Media - Audio and Video Synthesis | - | No support. |
| Media - Picture Recorder | - | No support. |
| Media - Video Decoder | - | No support. |
| Open Interface - Coupons | - | No support. |
| Open Interface - Invoices | - | No support. |
| Open Interface - Bioauthentication | - | No support. |
| Open interface - license plates | - | No support. |
| Open Interface - WeChat Channels | wx.openChannelsEvent | No support. |
| Open Interface - WeChat Customer Service | - | No support. |
| Equipment - Contacts | wx.addPhoneContact | No support. |
| Equipment - Accessibility | - | No support. |
| Equipment - amount of power | wx.onBatteryInfoChange / wx.offBatteryInfoChange | No support. |
| Devices - Network | wx.onNetworkWeakChange / wx.offNetworkWeakChange / wx.offNetworkStatusChange | No support. |
| Devices - Screen | wx.onScreenRecordingStateChanged / wx.offScreenRecordingStateChanged / wx.getScreenRecordingState | No support. |
| Devices - Memory | - | No support. |
| AI | - | No support. |
| Worker | - | Part of Support |
| Advertising | - | No support. |
| Skyline | - | Support is on the way |
| XR-FRAME | - | No support. |