Debug and Launch WeChat Mini Program

Last Updated on : 2024-06-24 04:11:52download

After a WeChat mini program is created, proceed to develop and launch the WeChat mini program on the Tuya Developer Platform.

Development Guide

  1. From the list of WeChat mini programs, find and click the newly created WeChat mini program.

  2. Enter the App Secret as instructed. WeChat mini programs are integrated with Tuya capabilities.

  3. Get Tuya’s cloud plug-ins for your WeChat mini programs. The smart pairing plug-in, automation plug-in, generic panel plug-in, and message center plug-in are supported.

  4. Open the WeChat DevTools, go to the Tuya Developer Platform, open your WeChat Mini Program SDK project, and then click Run Demo.

    Debug and Launch WeChat Mini Program
  5. Open the WeChat DevTools, change the AppID to that of your WeChat mini program, and then click Import.

    Debug and Launch WeChat Mini Program

Debug WeChat mini program and upload code package

After the local project passes the debugging with WeChat DevTools, you can scan the QR code on the Tuya Developer Platform to test the mini program on a real app. To upload the trial version of the WeChat mini program, you can manage the current version on the Versions page, and upload the code package. Then, a QR code is automatically generated for you to preview the trial version of the WeChat mini program.

Debug and Launch WeChat Mini Program

  1. On the Versions page, click Update App and enter the version number to create a version. Click Upload Code Package to upload the package of the local project.

  2. Before the upload, compress the package. Right-click the root directory of the package and compress it into a .zip file.

    Debug and Launch WeChat Mini Program
  3. Upload the compressed package to the newly-created version. According to WeChat’s strict requirements on the format and size of code packages, upload a .zip file of less than 10 MB. A single subpackage or main package cannot exceed 2 MB. Any package of more than 2 MB must be subpackaged. For more information about subpackaging, see Subpackage Loading. The following figure shows the layout of the code package.

    Debug and Launch WeChat Mini Program
  4. After the code package is uploaded, click Submit Code Package to generate a QR code. The administrator can scan the QR code and preview the trial version. To allow other users to preview it, follow the subsequent step and add them to Trial Members.

Add trial members

You can go to Add Trial Member and add trial members who can test the WeChat mini program. The trial members can scan the QR code on the Versions page to test and accept the mini program.

Debug and Launch WeChat Mini Program

Submit for review and launch mini program

  1. After the development and testing of the WeChat mini program, go to the Versions page, and click Submit for Review to submit the version and code branch to the WeChat platform for review.

  2. After the mini program passes the WeChat review, the Submit for Review button is changed into the Release Version button. After the version is launched, the WeChat mini program will be generally available and the QR code of the official version is generated.

FAQs

The cloud function deployment was found to be failed after I opened the WeChat Mini Program SDK project. How can I fix the problem?

Check whether cloud functions are deployed on the Tuya Developer Platform. If cloud functions are deployed, check whether the AppID of the imported code is the same as that displayed on the Tuya Developer Platform.

Debug and Launch WeChat Mini Program Debug and Launch WeChat Mini Program

I can submit a trial version both on the Tuya Developer Platform and by using the WeChat DevTools. What is the difference between these two processes?

Both processes work the same way. The Tuya Developer Platform has been granted access to your WeChat mini program, so you can upload the code, submit the trial version, submit for review, and then launch the mini program on the platform.

Does the layout of the code package must follow the figure mentioned in this topic?

Yes, it does. Your WeChat Mini Program SDK project must meet WeChat’s strict requirements on the format of the code package.

Can I use Taro and uni-app to develop WeChat mini programs with the help of Tuya’s cloud functions?

Yes, you can. But you need to pay attention to compilation and packaging differences. In addition, the code to be uploaded must be the code in the compressed dist folder.

Why is the code package limited in size?

The size of the code package is limited by WeChat. The total size of all subpackages of a mini program cannot exceed 10 MB. If the upper limit is exceeded, the WeChat mini program might have lags.

Why does the code need to be subpackaged?

WeChat requires that each subpackage or main package be up to 2 MB in size. If a code package exceeds 2 MB, it must be subpackaged. For more information, see Subpackage Loading.

Why did the review fail after I submitted the request?

Check whether you have submitted the demo code of the WeChat mini program. If the demo code is not submitted, check whether you have run into any of the situations as described in Common Rejections by WeChat.