Uniapp applies for APP version application signature, packaging, and the whole process strategy of applying for mobile applications on the WeChat open platform

1. Application Signature Application

1.1 Install jdk, jre, and set environment variables

Jdk download link

1.2 When you are ready, reopen the cmd window and type Java to see if it is configured correctly.**

insert image description here

1.3 If it has been configured correctly, execute the following command to generate the certificate. The generated certificate is saved in the startup directory of the current cmd**

The certificate alias and application name can be replaced with your own software name. But remember to save relevant information
keytool -genkey -alias certificate alias -keyalg RSA -keysize 2048 -validity 36500 -keystore application name.keystore

1.4 When prompted whether it is correct at the end, do not press Enter, enter y to confirm it is correct, otherwise you have to do it again. **

insert image description here

2. App packaging

  • Customize the Android package name: the original default Android package name is uni.UNIxxxxxxx, which needs to be removed from uni, and it is recommended to change it to com.xxxxx.UNIxxxxxxx
    because this package name will be used with the ios version later, so it is best to standardize the naming
  • Enter certificate alias, certificate password, select certificate file
    insert image description here

3. Obtain the application signature

1.1 Install [Signature Generation Tool] on the mobile phone or emulator

Download the official signature generation tool

1.2 Install the newly packaged apk on the mobile phone, and enter the custom package name in the second step

1.3 [Signature Generation Tool] will automatically obtain the list of app signatures installed locally. At this time, enter the custom package name filled in uniapp to get a string of application signature codes

insert image description here

4. WeChat open platform to apply for mobile applications

4.1 Prepare to apply the official website (if you have one, you can fill it in directly)

  • Application official website refers to the promotional material website of the mobile application currently applied for, and must include the footnote of the company, the actual use of the application, the application name, and application details (it can be simplified, only the application size, version information is also acceptable)
  • It cannot be a web page that needs to be logged in. You should be able to view the application content directly.
    insert image description here
    If you don’t know how to design, you can refer to this picture↓
    insert image description here

4.2 Application Flowchart

  • Must be a screenshot of the actual installation on the mobile phone, including battery power, mobile time and notification bar
    insert image description here

4.3 Fill in the previously applied application signature and application package name here, and click Submit for review

  • Select the application platform as needed, here I only use the Android application, so only the Android application is checked
    insert image description here

4.4 After successful generation, save the appId and appSecret properly

insert image description here

5. Points to note

WeChat official document
1. In the official development, it should be noted that the installation package under debug cannot be logged in with WeChat, and the code error code 40029 or 40125 will be reported. If you want to log in with WeChat normally, you must use the official
signature Install the package to install

2. It is not recommended to expose AppId and AppSecret information on the front end. This information should be saved in the back end and processed by the back end.
The front-end only needs to pass the code obtained after clicking WeChat login to the back-end, and the rest of the login logic is completed in the back-end

{
    
    
  "access_token": "ACCESS_TOKEN",
  "expires_in": 7200,
  "refresh_token": "REFRESH_TOKEN",
  "openid": "OPENID",
  "scope": "snsapi_userinfo",
  "unionid": "o6_bmasdasdsad6_2sgVtxxxxxxxx"
}

Guess you like

Origin blog.csdn.net/r657225738/article/details/130719675