Alipay mini program

Updated at:
Copy as MD

This topic describes how to integrate a published mobile application with an Alipay mini program.

Note

The instructions for using Alipay mini programs in this topic are for reference only. For more information, see the Alipay Mini Program Documentation Center.

Prerequisites

Limits

  • The account authentication feature is not supported. For more information, see Application authentication.

  • An Alipay mini program can be attached to only one mobile application. To attach the mini program to a different mobile application, you must first delete the verification file for the original mobile application and then upload the verification file for the new mobile application.

Step 1: Create a mini program

  1. Log on to the Alipay Developer Platform.

    Important

    If you do not have an account, follow the on-screen instructions to register. You must use an enterprise account to create the mini program because the required features are not available for personal accounts.

  2. Go to the Console page. In the My Applications section, choose Create Application > Mini Program.

  3. On the Create Mini Program page, enter a name for the mini program, such as Test, and click Create. After the mini program is created, the Version Management page is displayed.

Step 2: Configure H5 domain names

  1. In the navigation pane on the left, click Development Settings. On the Development Settings tab, find the H5 Domain Configuration section and click Add.

  2. In the H5 Domain Configuration dialog box, add the domain name of your mobile application.

    1. Click Download Verification File and save the file to your computer.

    2. Place the verification file in the root directory of your configured domain name.

      In the mobile application editor, click the Settings icon 设置 in the far-left navigation pane. On the Mini Program Settings tab, upload the verification file.

      Note

      Alipay verification files must have the .html extension.

    3. Click Click here to confirm that the verification file is accessible. After the validation is successful, enter the domain name in the Domain Name field and click OK.

      Note

      The domain name is the one you configured in Step 2: Publish the application.

  3. Add the official IoT Studio resource address: https://g.aliplus.com.

    1. In the H5 Domain Configuration section, click Add.

    2. In the H5 Domain Configuration dialog box, enter https://g.aliplus.com in the Domain Name field and click OK.

Step 3: Configure the mini program

  1. Run the miniapp development tool. In the navigation pane on the left, choose Alipay > Mini Program.

  2. On the Mini Program page, create a project. Enter a Project Name, select a Project Path, and click Finish.

  3. In the upper-left corner, select the Test mini program that you created. Replace the content of the index.axml application file with the following code.

    <view>
      <web-view src=" 
    Release address of the IoT Studio mobile visualization application 
    ?isMiniApp=true" />
    </view
  4. Publish and verify the mini program. For more information, see Publish a mini program.