PrefaceWe all know that the QR codes in official accounts can be long-pressed for recognition, but the restrictions on mini-programs are relatively strict, and there is no way to achieve long-press recognition of QR codes. I have always believed this, and this is also written in the official rules of WeChat. Until this morning, I accidentally discovered that the QR code in a mini-program can actually be long-pressed for recognition, so I curiously studied it, and it turned out that it is really possible to long-press and recognize QR codes in mini-programs. I don't know if it's an official loophole or a bug in the program, but since this function can be realized, of course I have to use it happily. As usual, let’s look at the renderings first As you can see, we have successfully implemented the function of long pressing to recognize the QR code in the mini program. Let me teach you how to achieve it step by step. Because the official specifications have not yet clearly stated that this feature is supported, this feature may be disabled at any time. I'll let you guys have some fun here first, and have fun for as long as you can. First, use webview to display the official account articlesWe know that the official account articles have the function of long pressing to identify the QR code, so we must first long press to identify the QR code in the mini program, and then we must display the official account articles in the mini program. How to display the official account articles in the mini program? Here we have to use webview. Webview is very simple to use, just follow the steps below. src is the link corresponding to our official account article. You only need to write it like this to complete the code part, and the rest is some configuration work. Second, you must link your mini program to the official accountIf you just find a link to a public account article and put it in the webview, the following problems will occur Next, we need to link the mini program in the background of the official account. I won’t explain here where to find the appid of the mini program. If you have learned mini programs, you will definitely know where to get the appid. 3. After setting, you can directly long press to identifyAfter the above association, there will be a delay of several minutes, so it is best to close the developer tools and then reopen them. You can see that we have successfully displayed the articles of the official account in the webview of the mini program. Then preview it on your phone as follows It can be seen that this is a standard public account article with a QR code at the end. So can we recognize this QR code by long pressing it? It can be seen that we successfully long-pressed and recognized the QR code. At this point, we have successfully implemented long press to recognize QR codes in the mini program. . . You should try it as soon as possible. I cannot guarantee 100% success because WeChat officials have not yet clearly developed this function. But now that mini programs can be shared to Moments, I believe that long pressing to identify QR codes in mini programs will not be prohibited, so take this opportunity to try this feature. SummarizeThis is the end of this article about long press to identify QR code in WeChat mini program. For more relevant WeChat mini program long press to identify QR code content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: How to set up FTP server in CentOS7
>>: How to delete extra kernels in Ubuntu
Because frameset and body are on the same level, y...
Table of contents Table definition auto-increment...
Table of contents Function Basic query functions ...
Table of contents How to view the source code of ...
Recently, https has been enabled on the mobile ph...
In the many projects I have worked on, there is b...
Install Enter the following command to install it...
Table of contents Background of this series Overv...
Regarding the nginx panic problem, we first need ...
I have been playing around with charts for a whil...
Table of contents Preface What are dynamic proper...
The blogger said : I have been writing a series o...
Use examples to familiarize yourself with the mean...
When implementing this function, the method I bor...
The complete syntax of the SELECT statement is: (...