简体   繁体   English

如何从网页链接到特定的微信小程序?

[英]How do I link to specific wechat Miniprogram from a webpage?

Whatsapp allows you to link to a new message via Whatsapp 允许您通过链接到新消息

<a href="whatsapp://send?text=The text to share!" data-action="share/whatsapp/share" class="Share-link m-whatsapp">

Like this how to redirect user from website to wechat miniprogram这样如何将用户从网站重定向到微信小程序

Wechat Mini Program can only be run within 1) the wechat app installed on iOS or Android 2) Weixin DevTools.微信小程序只能在 1) 安装在 iOS 或 Android 上的微信应用 2) 微信开发者工具中运行。 Thus it provides better user experience and also has more control over security concerns.因此,它提供了更好的用户体验,并且还可以更好地控制安全问题。

So the traditional 'url' ways not work for it.所以传统的“url”方式不适合它。 I tried logging in wechat both on my iphone and mac, then use my phone to share a mini program link to the mac client.我尝试在我的iphone和mac上登录微信,然后用我的手机分享一个小程序链接到mac客户端。 Then I got a message: You sent a Mini Program. View on mobile.然后我收到一条消息: You sent a Mini Program. View on mobile. You sent a Mini Program. View on mobile. . . So you can't even use mini program in mac's(macOS) wechat app.所以你甚至不能在mac(macOS)微信应用程序中使用小程序。

Actually a mini program is mostly accessed by scanning a 'The Mini Program code'.实际上,小程序主要是通过扫描“小程序代码”来访问的。 In your case if you have a website you could embed the code on your page and ask your user to use their wechat to scan that code.在您的情况下,如果您有一个网站,您可以在您的页面上嵌入代码,并要求您的用户使用他们的微信扫描该代码。 You may want to check information from the official dev doc of wechat .您可能需要查看微信官方开发文档中的信息

You can use WeChat's API to generate a short link of the form https://wxaurl.cn/pFawq35qbfd : https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-link/urllink.generate.html (in Chinese).可以使用微信的API生成短链接,格式为https://wxaurl.cn/pFawq35qbfdhttps://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-link /urllink.generate.html (中文)。

In the API call, you can specify a path into your miniprogram, and also pass query parameters.在 API 调用中,您可以指定进入您的小程序的路径,并传递查询参数。 Clicking the link in a Whatsapp or SMS message first opens an intermediate web page in a browser.单击 Whatsapp 或 SMS 消息中的链接首先会在浏览器中打开中间 web 页面。 That web page then contains a button to launch the miniprogram.那个 web 页面然后包含一个启动小程序的按钮。

Unfortunately it seems the API is not available to individual developers.不幸的是,个人开发者似乎无法使用 API。 You'll need a company account.您需要一个公司帐户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM