Updated on 2025-09-04 GMT+08:00

Releasing the Developed Application as a Mobile Applet

The application designer offers a one-stop solution for configuring and releasing mobile applications. Once developers complete the application configuration, users can easily access and share applications within the mobile application container.

This section uses OneMobile as an example to describe how to release an application as a mobile application.

Enabling the Mobile Applet Mode

Enable the applet mode on the Settings > Application Settings > Mobile Settings page. After this function is enabled, you can release the current application as a mobile applet. If the applet mode is disabled, developers cannot release and generate mobile applications.

  1. Log in to the application designer by referring to Logging In to the Application Designer.
  2. In the navigation pane, choose Settings. The Application Settings page is displayed.
  3. Choose Mobile Settings. On the displayed page, enable Applet Mode.

    Figure 1 Enabling Mobile Applet

  4. After the applet mode is enabled, select the supported applet type in Applet Release.

Releasing an Application to OneMobile

To release standard and advanced pages of an application to Huawei OneMobile, you need to enter the username and password of Huawei OneMobile or scan the QR code to log in. After you select this mode, a QR code is generated on Huawei OneMobile. You can scan the QR code to experience the application as prompted.

  1. After the Huawei Cloud Astro Zero applet package is released to OneMobile, the login-free logic needs to be processed when the applet is accessed in OneMobile. In this way, the access token of Huawei Cloud Astro Zero is obtained, and the token is carried in subsequent requests to request service data.

    There are two methods to implement the login-free logic. If both methods are configured, method 1 is preferred.

    • Method 1: Developers create their own login-free API. Specifically, they develop a flow in the BO or application to obtain a token for accessing Huawei Cloud Astro Zero, and then encapsulate this flow into a login-free API. This allows developers to set permissions for each portal user and control their access to Huawei Cloud Astro Zero APIs.
      1. Develop a script to call the details query API of a portal user to obtain the portal user details and check if the portal user exists in in Huawei Cloud Astro Zero.
        • If yes, obtain the portal user details.
        • If no, create a portal user.
      2. Develop a flow to call the login API (using the formula within the flow) to obtain the token.
      3. Encapsulate this flow into a login-free API, which serves as the login-free request URL for the Huawei OneMobile applet.
      4. In the environment configuration page for the service API, configure the built-in system parameter token_url_in_shinemo to the login-free request URL of the Huawei OneMobile applet.
        On the left of the environment configuration page, choose System Settings > System Parameters, and click the Built-in System Parameters tab. Configure token_url_in_shinemo by referring to Table 1.
        Table 1 token_url_in_shinemo parameter description

        Parameter

        Description

        token_url_in_shinemo

        Login-free request URL of the Huawei OneMobile applet, that is, the API URL of the flow encapsulated in 1.c.

        URL for obtaining the access token of Huawei Cloud Astro Zero. This parameter is set to the URL of the Huawei OneMobile applet. If this parameter is not set, an error will occur when opening the applet in Huawei OneMobile due to the service request lacking an access token.

    • Method 2: Use the preset login-free logic and configure the login-free information in the environment configuration page that carries the service API.
      1. On the Huawei Cloud Astro Zero console, click Access Homepage to go to the application development page.
      2. Click in the upper left corner of the page and choose Environments > Environment Configuration.
      3. In the navigation pane, choose Integrated Connection > Identity Authentication.
      4. In the Preset area, click OneMobile and configure Applet Environment, App Key, and App Secret.
        Figure 2 Setting parameters for binding OneMobile
      5. After the setting is complete, click the button to bind OneMobile. A maximum of 10 OneMobile accounts can be bound.

  1. Package and release the application to the runtime or sandbox environment with a few clicks by referring to Releasing and Deploying Applications Quickly.
  2. Release an application and log in to the developer platform.

    1. In the upper part of the application designer, click Publish and click Generate Mobile App.
    2. On the displayed page, select Huawei OneMobile Mini Program. The page for selecting the Huawei OneMobile environment is displayed.
    3. On the page, select the OneMobile environment to be logged in to and click the confirm button. The login page of the developer platform is displayed.

      If no environment is available, click the button to add an applet environment. (A maximum of 10 OneMobile environments can be added in the current version.)

      As a development tool for OneMobile applets, Huawei Cloud Astro Zero enables you to release developed applets to the OneMobile open platform with just a few clicks. OAuth 2.0 is used for authentication and binding between Huawei Cloud Astro Zero and OneMobile developer accounts. Currently, the integration between the development tool and the open platform is system-level. The open platform provides client ID and client secret as authentication credentials for the tool. These credentials are used by the tool to perform operations on the open platform data, such as querying applications created by developers and applet packages pushed by them.

      OneMobile is not independently deployed on the cloud. The credentials vary by environment. Contact the O&M personnel for each environment to obtain the IDE-related configurations from the sync-contact service.

      Figure 3 Adding the OneMobile environment
    4. On the login page, enter your account, password, and verification code, then click the button to log in.
    5. Release the standard and advanced pages in the application to Huawei OneMobile.
      Table 2 Parameters

      Parameter

      Description

      Mini Program name

      Select the name of the application to be released to Huawei OneMobile.

      Home

      Default page displayed when you open the Huawei OneMobile applet.

      Environment Type

      Huawei Cloud Astro Zero environment that carries applications, such as the development environment, runtime environment, and sandbox.

      Runtime environment/Sandbox domain name

      Sets the domain name of the runtime environment or sandbox. This parameter needs to be set only when the environment type is set to the runtime environment or sandbox.

      Runtime environment/Sandbox tenant ID

      Tenant ID of the runtime environment or sandbox environment. After the configuration, the tenant ID is automatically added to the request header when the applet is running. To obtain the value, perform the following steps:

      1. Log in to the runtime environment or sandbox environment.
      2. In the navigation pane of the environment configuration page, choose System Settings > Company Information.
      3. You can obtain the tenant ID from the company information.

      Debug mode on

      Indicates whether to enable the vConsole debugging function when the applet is running on Huawei OneMobile. After this function is enabled, you can click vConsole on Huawei OneMobile to view logs.

      Enable js compiler

      This parameter is displayed only when the packaged app contains advanced pages. After it is enabled, JavaScript compilation is performed on the plugins and resources referenced by advanced pages to standardize the code.

      Advanced Settings > Navigation Bar Display Mode

      Whether to display the navigation bar when the applet is displayed.

  3. Release an applet in the OneMobile applet container management background.

    1. Log in to the OneMobile applet container management backend and upload the applet package to be released.
    2. After the applet is uploaded, click the QR code displayed next to the applet version to be submitted for review, scan the QR code, and download the applet for preview.
    3. Click the submit button next to the uploaded applet to submit it for review.

      After the applet is approved, you can use or test the applet.