Last Updated on : 2023-09-20 08:54:33download
MiniApp offline package is an offline package downloaded to the local system. The package provides all programs and resources that are required to run miniapps. You can integrate the offline package into your native app. Then, when the miniapp is running, it loads the local offline package in priority. If the offline package does not exist, the latest resource package is downloaded from the cloud to run the miniapp.
To improve the user experience of miniapps, the offline package comes with the following capabilities:
Speed up miniapp startup.
During the process of opening a miniapp, if an offline package exists on the local system, it will be loaded in priority. This reduces the time consumed by network requests and accelerates the startup of the miniapp.
Support compatibility with private deployment.
When a miniapp is running, it makes requests to servers. If your app is deployed in a private cloud, but the private deployment is not applied to the MiniApp service accordingly, the miniapp cannot run normally. However, thanks to the capabilities of the offline package, you can download the package of programs and resources required by the miniapp to the local system and enable the miniapp to run.
Control the auto update policy for miniapps.
To control the auto update policy of a miniapp and make it stay at a version, you can build an offline package and allow the miniapp to load this package only.
Smart MiniApp IDE will support the auto building of offline packages in the near future. Currently, contact Tuya to help build an offline package for you. To build an offline package, provide Tuya with the following information:
thingsmart-bizbundle-miniapp
.thingsmart-bizbundle-XXXkit
that is integrated into your project.miniprogam
of the target miniapp.[
{
"id": "xxxxx",// The miniapp ID, required.
"version": "1.2.3",// The version number at which the miniapp stays. Optional. If you specify a version number, the offline package will be built based on this version number.
"path": "pages/index/index",// The page that provides access to the miniapp. Optional.
"pid": "xxxxx",// The productId with which the panel miniapp is associated. This parameter is required for panel miniapps.
"onlyloadoffline": "true"// Specifies whether to only load an offline package. Optional.
},
...
]
The version number of the component thingsmart-bizbundle-miniapp
on which the project depends.
thingsmart-bizbundle-XXXkit
on which the project depends.thingsmart-bizbundle-XXXkit
on which the project depends, for example, thingsmart-bizbundle-basekit
and thingsmart-bizbundle-bizkit
.The result of the offline package build is a .zip
compressed file, named miniapp_offline.zip
.
miniapp_offline
.miniapp_offline
to the assets
directory of the project, and compile and build the program.After the integration of the offline package, you can verify the integration result. Perform the following steps:
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback