All Products
Search
Document Center

Mobile Platform as a Service:Create offline packages

Last Updated:Feb 21, 2023

When creating an HTML5 offline package, you must complete the basic configuration of 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.

    HTML5 app ID must be a 8-digit number.

    Important
    • The H5App ID is an 8-digit number.

    • 20000196, 66666692, 68687029, and 68687209 are offline package IDs built into the SDK. It is recommended not to use the H5App ID, otherwise conflicts will occur.

    • It is recommended not to use numbers starting with 666666 or 20000 for H5App ID.

  4. Select the HTML5 app from the HTML5 app list, and click Add an offline package on the right.

  5. Configure the following information in the Basic information section:

    • Resource package type: Select Global resource package or Normal resource package.

      Note

      If you use the global resource pack, you need to change the name of the secondary 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 .zip format.

    • 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.

      Note
      • At 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.plist file.

  6. In the Configuration information section, configure the following information:

    • URL of main entrance: 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: 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 1800indicates 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 belongs 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-digit number.

  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 configurations.

    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 HTML5 offline package appears on the HTML5 offline package management page, which indicates that the offline package has been created successfully.

What to do next

Release offline packages