Know programmers, focus on micro channel small program development programmers!

1. What should I do if I fail to pass the wechat mini program review?

There are many reasons for the failure of the small program review. Wechat will give the corresponding reasons for the failure of the review. Today, liansheng teacher to introduce to you after the audit does not pass, how to remedy?

A. Modify the applets service category

When the review fails, you can search similar small programs to see what service category they choose, and then modify it to be the same as them and submit again

B. Reapply for a mini-program

There are also some small programs that were rejected because they were submitted for the first time. When they are submitted again, wechat officials will check the reason why they failed in the last review, so they may be rejected again. Just apply for a new applet and submit the code

C, the ultimate solution, server switch control

In this way, the applet first sends an API request, according to the server to return different values, display different page content. You can ensure that when submitting the audit status, there is one interface. After passing the audit, adjust the server switch and the user will see another interface.

If you submit the code again next time, just use another switch, it can still ensure that the online user is normal, and the reviewer can also view the normal ~


The switch can actually be in the form of a value, such as:

https://xxx.com/applet/switch?name=taobaoke&vers ion = 1.0.0

Each trial can use a new switch, code to modify the parameters on the line ~


Wx. setStorageSync error

This question, before the article inside also mentioned, again today.

Wechat official API implementation problems, there is a certain probability of error, the more frequently called, the more errors reported, you can log in the small program background to see the details of the error ~

The solution is to add a try catch to solve 90% of the error cases.


Iii. How to let all users get the latest code after issuing the new code?

For those of you who know about applets, you should know that applets are cached. That is to say, when a user opens an applets, if there is a local cache, the user will read the resources from the cache by default.

The problem is that users can’t force refresh, can only silently wait for wechat to update the small program code (of course, you can take the initiative to delete the small program, and then search & open, which is too expensive for small white users).

There is always a way, Liansheng teacher thought of opening debugging API, as follows:

Every time you open or close the debug panel, the small program will automatically close, and then open again, the code must be up to date.

Try turning debugging on and off when the user clicks a button or directly inside onHide. It worked better on IOS than on Android, but it wasn’t perfect


4. How to prevent page scrolling events from custom pop-ups

Some students need to do custom pop-up box, but after the pop-up box does not want to let the page can slide, this is actually easy to solve ~

Add catchTouchStart to the cover of the popup, write a line of code in it, and then the parent node will not receive the event bubble.