Home >WeChat Applet >Mini Program Development >Solution to solve the problem that WeChat cannot directly download the app

Solution to solve the problem that WeChat cannot directly download the app

little bottle
little bottleforward
2019-04-19 16:57:227195browse

I believe many friends have encountered this problem. Your own app cannot be downloaded directly through WeChat promotion. Instead, you need to use a mask layer to prompt users to download. Click the download button and it prompts you to click the upper right corner to open it in the browser. To download an app in this way, do you need to click the download button twice, click the three circles in the upper right corner once, click once to open it in the browser, and you need to click the screen at least four times. Only one operation can be completed.

This is the solution I found on Baidu: We hope to allow users to download the apk by scanning the QR code, but WeChat blocks this method. Is there any way to achieve this?

The methods used here are summarized into three types:

1. Put it on App Store and then use App Store’s promotion link to promote it

2. Use a mask layer to prompt Upper right corner

3. Tornado micro-jump: http://www.zjychina.cn WeChat jumps directly and opens the browser to open the APK download page

Discussion

Type 1 , first apply for Tencent's open platform, and then the application needs to be reviewed and approved, which is quite cumbersome, and some applications cannot be put on the App Store.

The second type is a method that can be seen everywhere in the market at present, and it is also a method that cannot be helped.

The third type is more convenient

Okay, so much nonsense and let’s get to the point, here is the solution.

First type

If your app.apk is placed on your own server and then uses nginx/apache/tomcat, then you need to modify the configuration of the response header.

Use apache as an example here:

Find the configuration file:/usr/local/apache2/conf/mime.types

Search for apk in the file and change it to the following

# application/vnd.android.package-archive apk

application/octet-stream apk

After making the changes, just restart apache. It’s that simple.

Then you can send the url of the apk to WeChat and try it out to see if it really works.

Second type (recommended)

If you use CDN acceleration, in fact, CDN can directly configure the response header. Here is Alibaba Cloud CDN as an example

Set HTTP headers and parameters Content-Type, the value is application/octet-stream

. This method eliminates the need to modify the server configuration file and does not require stopping and restarting the server.

Related tutorials: Video tutorial on developing WeChat mini programs


The above is the detailed content of Solution to solve the problem that WeChat cannot directly download the app. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete

Related articles

See more