All Products
Search
Document Center

Create offline packages

Last Updated: Jul 16, 2021

When creating an offline package, you need to complete basic configurations about the offline package.

Prerequisites

You have configured an offline package on the Manage configurations page. For more information, see Configure offline packages.

About this task

You can create a single HTML5 offline package, or create multiple offline packages at a time by batch importing HTML5 offline package files.

When you upload the first offline package for an HTML5 app, you must select the offline package type. Once the offline package type is selected, it can not be changed. Each HTML5 app has only one type of offline package.

Procedure

Create a single offline package

Go to the mPaaS console, and perform the following steps:

  1. On the left navigation bar, click Mobile Delivery Service > Offline package management.
  2. On the offline package list page, click Create an HTML5 app. You can skip this step if an HTML5 application already exists.
  3. In the Create an HTML5 app window, enter the HTML5 app ID and HTML5 app name, and then click Submit. You can skip this step if an HTML5 application already exists.
    Note: HTML5 app ID must be eight digits.
  4. On the page of the added HTML5 app, click Add.
  5. Configure the following information in the Basic information section:
    • Resource package type: Select Global resource package or Normal resource package.
    • Version: Enter the version of the offline package, for example, 1.0.0.1.
    • Client verison range: Select the type of the client and enter the minimum and maximum versions of the client.
      Note: At least one client type is required. Only clients within the version range can receive the new offline packages. The version of iOS client must be lower than the value of Product Version field in the project’s info.plist file.
    • File: Upload the offline package file in .zip format.
  6. In the Configuration information section, configure the following information:
    • Main entrance URL: Optional. The homepage of the offline package.
      Note: A complete path is required, such as /www/index.html, where /www is the name of second-level directory you customized.
    • Virtual domain name: 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 (,).
      Note: 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, where 1800 indicates 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 Access Android client and Access iOS client.
    • Network for download: Choose the network environment for downloading the offline package. You can choose Wi-Fi only or All networks.
      • 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.
  7. Check I confirm the above information is accurate, and submit without any further change, then click Submit.

Batch import offline packages

When creating multiple offline packages, you can choose to import the packages in batch to improve efficiency and avoid errors during configuration.

Note:
  • After importing, if the app to which the offline package belongs does not exist on mPaaS, an HTML5 app will be created automatically.
  • After importing, if the app to which the offline package already exists on mPaaS, the package will be added to the HTML5 app when configuration is complete.

Go to the mPaaS console, and perform the following steps:

  1. On the left navigation bar, click Mobile Delivery Service > Offline package management, then click Batch import HTML5 app.
  2. In the popup window, follow the on-screen instructions to upload the ZIP offline package file and the configuration file.
    Note:
    • The file size cannot exceed 300 MB, and the number of offline packages cannot exceed 100.
    • The offline package resource file must be named after the offline package ID, which must be 8 digits.
  3. In the import result list, click Edit in the Operation column to edit the offline package. Refer to Create a single offline package for details about the configrations.
    Note: The default version of imported offline packages follow the rules below, and you can edit the versions based on your needs.
    • If the app to which the offline package belongs does not exist on mPaaS, the default version of the package is 0.0.0.1.
    • If the app to which the offline package belongs already exists on mPaaS, the default version of the package is to add 1 to the currently highest version number.
  4. After completing editing all the packages, check The information can’t be modified after submission, and click Submit.The submitted offline package information will be verified. If verification fails, error message will appear. If verification succeeds, the offline package appears in the offline package management page, which indicates that the offline package has been created successfully.

What to do next

Release offline packages