Many people still think that the small program can only jump to each other in the wechat environment, do not know that in fact [URL Scheme] can realize the non-wechat environment jump, and it is simpler than using the content of the wechat environment development label jump small program

Some holiday events or business needs that need to direct H5 users to applets can be a bit of a hassle,

If the app is still working properly, you can use the “wX-open-launch-appellate” app provided by wechat to start appellate apps.

Developers.weixin.qq.com/community/d…

Now talking about the non-wechat environment to open our own small program, how to achieve?

We can use the URL Scheme address provided by wechat to realize the jump.

The specific operation is as follows:

How to obtain the [URL Scheme] address, there are two ways to obtain it?

1. You don’t need to adjust the interface through the server. By logging in to the public platform, you can get the URL Scheme of any page of the applet opened by “tool” – “Generate URL Scheme” entrance (the position is in the upper right corner after login), and fill in the page address and parameters of the applet you need to jump to, click Generate

2, can be achieved by WeChat server-side API interface to generate address URL Scheme 】 【 to be obtained, using a token can be achieved, the generated address and parameters are the same as above, you can configure the corresponding parameters, address: developers.weixin.qq.com/miniprogram…

How to use it correctly?

IOS supports THE recognition of URL schemes, which can be used to access applets in application scenarios such as SMS.

Android system does not support direct recognition of URL Scheme, so users cannot open applets normally through Scheme. Developers need to use H5 page transfer, and then jump to Scheme to open applets. Examples of redirect codes are as follows:

location.href = 'weixin://dl/business/? t= *TICKET*'Copy the code


Href = ‘URL Scheme address’. This may occur. Some browsers will automatically intercept the content automatically executed by the script, resulting in the jump applet cannot be immediately activated on the jump H5 page, so the page had better keep a button. Click this button to jump to the applet.

Now you can open wechat applets in non-wechat environment browser. Good luck and no bugs in your code (note: enterprise wechat also supports this [URL Scheme] applets).