uniapp App jumps to WeChat applet

        Recently, the development of the APP project was completed. At the review meeting, the boss raised a demand and wanted to add a link to the developed APP, which can jump to the company's small program mall.        

        I thought it would be very complicated, but it turned out to be only a few lines of code.

        plus.share.getServices(function(res){                var sweixin = null;                  for(var i=0;i<res.length;i++){                        var t = res[i];                        if(t.id == 'weixin' ){                              sweixin = t;                        }                  }                  if(sweixin){                        sweixin.launchMiniProgram({                               id: 'gh_8888888', // write here the original id of your mini program (starting with gh)                             type: 0,//here are different environments (Default 0)                             path:'/pages/shop/index?storeId=123456'// Here is the path of the specified page, if you need to pass parameters, direct string splicing (the home page can be omitted)                      });  













               }  
      },function(res){  
              console.log(JSON.stringify(res));  
     });

After the code was added, I ran it on a real machine , and jumped to the target applet perfectly, so smoothly. Happy packing, ready to close. Then found that Manifest.json reported an error and could not be packaged

After inspection, it is found that the Universal Links (Universal Links) of the ios platform in the App module configuration in the mainfest.json file cannot be empty

Let's configure it, click on the reference document, and follow the steps given to configure and generate Universal Links, a total of three steps. 

Reference document: uni-app official website

Open cloud service space and front-end web page hosting: open uniCloud (Aliyun version) cloud service space and open front-end web page hosting-DCloud Q&A

After completing the first two steps, click the Auto Generate button and follow the prompts to generate your own Universal Links

Next, proceed to the third step, configuring Universal Links to the WeChat open platform.

Log in to the WeChat open platform, and create a mobile application in the mobile application module

WeChat Open Platform: WeChat Open Platform

-------------------------------------------------- ----------Dividing line-------------------------------------- ----------------------

-------------------------------------------------- ----------Dividing line-------------------------------------- ----------------------

In the android application, the application signature is the MD5 in the certificate when we generate the certificate. Of course, the ":" in the MD5 signature should be removed here, and then the uppercase letters should be replaced with lowercase. for example:

MD5为:18:12:66:53:D0:E2:89:95:5A;F1:6F:45:EE:FA:2C:48

The application signature is: 18126653d0e289955af16f45eefa2c48

The query command is: keytool -list -v - keystore xxx.keystore

Here, some small partners only have SHA1 and SHA256 when querying, without MD5. That's because of the problem of the SDK version. The higher version discards MD5. Please download the lower version and check it. I use: jre1.8.0_71

After completing all the filling, submit it for review. After the review is passed, you will have the permission to jump to the applet in the mobile application

At this time, pack the app and jump to the applet. If the pop-up window " bad_param " is returned , it is because the appid in the Share (share) in the manifest.json is wrongly written, and the appid to create the application in the WeChat development platform should be written:

At this time, pack the app and jump to the applet. If the pop-up window " has_no_permission " is returned, it is because your WeChat development platform account has not been authenticated, and it can only be used after enterprise authentication.

Certification needs to pay 300 oceans , and the enterprise payment certification is required. When the company information is reviewed and before the company account is authenticated, an audit specialist will call you to confirm. Remember this mobile phone number , which will be useful later. In addition, before the company sends money for certification, there will be an audit filling button, which allows uploading files. Don't click it, don't worry about it, no action is required. After you complete the payment authentication, you need to tell the reviewer, that is the mobile phone number, Call her. She will ask you the company name, and then issue a certification to you. After the certification is passed, you can jump to the applet

After working on this function, I encountered all kinds of pitfalls. I have been busy for nearly a week, and I can't find solutions from the Internet. It is really uncomfortable to piece together. I compiled a relatively complete version of the plan by myself, recording the various pits and solutions I encountered. There should be friends who are in contact with me for the first time, so I will talk about it in more detail. Don’t think I’m long-winded. I hope it can help everyone

Guess you like

Origin blog.csdn.net/fbqgdxw/article/details/121676030
Recommended