To create an HTML5 offline package, you must enter basic and configuration information.
Prerequisites
You must have configured the HTML5 offline package on the Configuration Management page. For more information, see Configure an offline package.
About this task
You can create HTML5 offline packages individually or create multiple packages at once using the batch import feature.
When you upload an offline package for an H5App for the first time, you must select a package type. This selection cannot be changed later. Each H5App can have only one package type.
Procedure
Create a single offline package
Log on to the mPaaS console and follow these steps:
In the left navigation pane, choose Mobile Delivery Service> Offline package management.
On the Offline Package Management page, click Create an HTML5 App. (If you have already created an H5App, skip this step.)
In the Create an HTML5 App window, enter the HTML5 App ID and HTML5 App name, and then click OK. (If you have already created an H5App, skip this step.)
ImportantThe H5App ID must be an 8-digit number.
The IDs 20000196, 66666692, 68687029, and 68687209 are built into the software development kit (SDK). Do not use these IDs for your H5App to avoid conflicts.
Do not use an H5App ID that starts with 666666 or 20000.
Select the HTML5 app from the HTML5 app list, and click Add an offline package on the right.
In the Basic Information section, configure the following parameters:
Resource package type: Select Global resource package or Normal resource package.
NoteIf you use the global resource pack, you need to change the name of the second-level directory in the global resource pack to mcube-prod.mpaascloud.com, otherwise you will not be able to use the acceleration capability of real-time release docking.
HTML5 app version: Enter the version of the offline package, for example, 1.0.0.1.
File: Upload the offline package file in
.zipformat.Client version: Select the type of the client and set the version range. Only the clients within the version range can receive the new offline packages.
NoteAt least one client type is required. If both Android and iOS are selected, you should ensure that the both clients adopt the same strategy on the latest version. Specifically, the latest versions of both clients should be either kept empty (system default) or set as the same value.
If the latest version is kept empty, all future versions will be supported. It is recommended to to set it as default, in case that the offline package becomes ineffective when the version of the upgraded client is higher than that is previously specified.
The version of the iOS client must be older than the value of Product Version field in the project's
info.plistfile.
In the Configuration Information section, configure the following parameters:
URL of main entrance: Optional. The homepage of the offline package.
NoteA complete path is required, such as
/www/index.html, where/wwwis the name of second-level directory you customized.Virtual domain: The virtual domain name that you enter when you configure the offline package is automatically displayed.
Extended information: Optional. Enter the page loading parameters in key-value (KV) formats. Separate multiple KV pairs with commas (,).
On the mPaaS platform, you can configure a request interval for HTML5 offline packages. You can apply the settings to a single offline package or globally.
Single package configuration: Apply to the current offline package only. In the Extended information field, you can enter
{"asyncReqRate":"1800"}to set the request interval, where1800indicates the interval. The interval is measured in seconds and ranges from 0 to 86400 seconds (0 to 24 hours). Value 0 indicates no limit on request interval.Global configuration: Apply to all offline packages. This parameter is specified in the client code. For more information, see Getting started and Getting started.
Time for download: Select the time when the user downloads the offline package.
If you select Wi-Fi only, the offline package will be automatically downloaded in the background only with Wi-Fi connection.
If you select All networks, in non-Wi-Fi network, the offline package will still be automatically downloaded consuming user’s mobile data. Thus, set it with caution.
Time of installation: Select the time to install the offline package.
If you select Not preload, the offline package will be installed only when the offline package is opened.
If you select Preload, the offline package will be automatically installed after the offline package is downloaded.
Select the I confirm the above information is accurate checkbox, and then click Submit to finish creating the offline package.
Import offline packages in a batch
To create multiple offline packages at once, you can import them in a batch. This method improves publishing efficiency and helps prevent configuration errors.
After the import, if the H5App to which an offline package belongs does not exist, a new H5App is created by default.
If the H5App to which an offline package belongs already exists, the offline package is added to that H5App after configuration.
Log on to the mPaaS console and follow these steps:
In the left navigation pane, choose Mobile Delivery Service> Offline package management, and then click Batch import HTML5 app.
In the Batch import HTML5 app window, follow the prompts to upload the HTML5 offline package files (.zip).
NoteThe total size of the imported offline package files cannot exceed 300 MB, and the number of packages cannot exceed 100.
Each offline package resource file must be named with its corresponding 8-digit offline package ID.
The import results page lists the successfully loaded offline packages. On this page, click Edit in the Operation column to edit the basic information for an offline package. For an explanation of the configuration items, see Create a single offline package.
On the import results page, the offline package version number defaults to the following rules. You can edit the version number.
If the H5App for the offline package does not exist, the version number of the imported package defaults to 0.0.0.1.
If the H5App for the offline package already exists, the version number of the imported package defaults to the next incremental version number based on the highest existing version.
After you finish editing all offline packages, select the The information can't be modified after submission checkbox, and then click Submit. The system validates the submitted information. If the validation fails, an error message appears. If the validation passes, the HTML5 offline package information appears on the Offline Package Management page, which indicates that the packages were created successfully.