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
1. Download the axios plugin cnpm install axios -...
Table of contents 1. Introduction 2. Environment ...
Many organizations have the need to back up file ...
1. Use contrasting colours. The contrast here ref...
After I analyzed the Taobao details page last time...
Overview Today we will mainly share how to config...
Preface We all know that startups initially use m...
MySQL 5.7.20 zip installation, the specific conte...
When writing a Dockerfile, include an entrypoint ...
The three-dimensional column chart consists of th...
Reference: MySQL character set summary utf8mb4 ha...
1. Download the zip installation package Click he...
I have been playing around with charts for a whil...
Background of the accident: A few days ago, due t...
In the previous article, we introduced how to use...