Scan ordinary link QR codes to open Mini Programs
In order to enable Mini Program developers to promote Mini Programs more easily, there are already QR codes that are compatible offline. The WeChat Official Account Platform has opened up the capability to scan ordinary link QR codes to launch Mini Programs instantly.
Introduction to function
The term “ordinary link QR codes” refers to QR codes that are generated after developers use tools to encode web links.
Offline merchants do not need to change offline QR codes, and after they complete the configuration of a Mini Program’s backend, users can open the Mini Program and use its functions when they scan ordinary link QR codes.
Ordinary link QR codes currently support using Scan QR Code in WeChat to scan directly and launch Mini Programs instantly. For the time being, they do not support opening Mini Programs by holding down Extract QR Code in WeChat.
Scope for opening
Corporate, Government, Media, and Other Organizations type Mini Programs.
QR code redirection rules
When scanning QR codes, the WeChat client will control redirection in accordance with the following matching rules:
- The rules for QR code link protocols, domain names, paths, and configured QR codes are the same.
- If the QR code rules contain parameters, link “?” The parameter part is at the end, the parameter is required to match the prefix
Common matching error types:
|Configured backend QR code rules||Complete offline QR code link||Error reason|
|https://www.qq.com/a/b||https://www.weixin.qq.com/a/b||Domain name differs|
|https://www.qq.com/a/b?id=123||https://www.qq.com/a/b?id=132||Parameter does not match prefix|
QR code content acquisition
After the rules for instant launching of the Mini Program with a QR code have been configured in the Mini Program’s backend (client version 6.5.6 or above), scanning a QR code will open the Mini Program.
The QR code link content will be brought to the page using the q parameter. Extract the q parameter from the onload event and run urlDecode once to acquire the complete content of the original QR code.
Log in to the Mini Program’s backend and enter Settings-Development Settings-Scan Ordinary Link QR Code To Open Mini Program. You can configure QR code rules after launching this function.
QR code rules
In accordance with the QR code redirection rules, developers are required to enter the QR code rules required for the instant launching of Mini Programs. The requirements are as follows:
The domain names for QR code rules must pass ICP license verification.
One Mini Program account can configure a maximum of 10 QR code prefix rules.
Prefix usage rules
Developers can choose whether to engage all sub-rules that comply with QR code matching rules. If they choose to engage these sub-rules, other accounts cannot request to use other sub-rules that satisfy the matching rules for the prefix.
For example: If developer A configures the QR code rule https://wx.qq.com/mp?id=123 and selects Engage All Sub-Rules, other developers will be unable to configure sub-rules that satisfy prefix matching, such as https://wx.qq.com/mp?id=1234.
If the prompt “This rule is already in use” appears, contact the corresponding Mini Program developer to resolve this.
You need to download the random verification documents, then upload these documents to a directory in a designated location in the server before you can pass ownership verification.
Verification document placement rules: Place verification documents under the last sub-directory declared in the url. If there is no sub-directory, then place them under the top level directory of the server belonging to the host. Please place verification documents under the designated directory according to the prompts on the page.
Mini Program function page
The Mini Program function page path after configuring QR code scanning, for example: pages/index/index.
Testing and debugging
Developers can perform testing and debugging on configured QR code rules.
Testing is only effective on test links and WeChat users within the test range. When other users are redirected to a web page after scanning a QR code, this will not affect the normal usage of all users on the network. After QR code rules are published, developers can still choose to perform testing under a designated version (development version/experience version/online version).
Developers can choose to test the Ordinary QR Code Mini Program Redirection function in the development version/experience version/online version according to the development progress.
Enter the complete QR code link that complies with a QR code prefix matching rule to be used for testing. If this includes a parameter, please enter this in full.
A maximum of five test links can be entered for one rule. These can be altered more than once. If the QR code matches a test link, and the user’s WeChat ID is that of a Mini Program’s designated administrator/developer/experiencer, then the designated version of the Mini Program will be opened.
Developers can publish QR code redirection rules on the existing network after testing is completed. After publication, scanning all QR codes that comply with matching rules will redirect you to the designated Mini Program page.
In order to guarantee the user experience, Mini Programs must publish code before they can publish QR code redirection rules.
One Mini Program account can publish a maximum of 20 QR code redirection rules per month.