如图,最近有看到新浪的移动端网页,增加了微信分享功能。在浏览器APP(Safari除外)中可以直接调用微信APP,分享至朋友圈或者聊天窗口。并不像很多网站是通过弹出一个图片提示右上角分享。
我是一个产品汪,经过我分析,并不是通过微信接口实现的,而是直接调用了浏览器APP自带的微信分享功能。比如我用安卓手机自带webkit内核浏览器(原生浏览器没有微信分享功能),打开新浪文章页,就不会出现这个微信分享的功能按钮。
不知这是怎么实现的,不是原生APP调用微信接口,也不是PC网页微信分享代码。请看清试用环境,求大神帮忙解答~~~~
update:
This tool written by Jeffery Wang is good and saves a lot of things. Dancing will be great! !
http://segmentfault.com/q/1010000002539562?_ea=313592#a-1020000002912654
---- cut ----
update: js-sdk
Refer to WeChat’s latest js-sdk
http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html
You can also analyze the js of Sina Mobile official website
http://mjs.sinaimg.cn/wap/module/share/201501261608/js/addShare.min.js
I don’t know if the address will be If so, please post the code at the bottom. .
update: The following answer is wrong! Please do not refer.
-------cut-------
Why does the product owner need to know this kind of thing? Just leave it to the programmer, and the ape can do it.
-------cut--------
Okay;
To share computer web pages to WeChat by scanning, just use this jiathis plug-in.
http://www.jiathis.com/help/html/weixin-share-code
-------cut--------
I just organized it yesterday and created a project on github: https://github.com/JefferyWang/nativeShare.js
WeChat sharing sdk called by APP
WeChat’s SDK can only be used in WeChat’s built-in browser. I also discovered that NetEase has this sharing function. So I made some changes. Suitable for your own website. But there is a problem that prevents me from using http://jsapi.qq.com/get?api=Who can tell me what this request is for. Check whether the URL belongs to Tencent and is free and open source.
Have you finally implemented this function?
http://ask.dcloud.net.cn/docs/
May I ask where you saw this feature? Can you tell me more specifically?
What to do with the built-in browser built into WeChat
Old question, I just saw it.
Sina’s implementation is as follows:
Because in native apps, there are permissions to directly invoke WeChat sharing, and some apps, such as UC Browser and QQ Browser, delegate these permissions to the page.
So, when the page detects that it is opened in uc or QQ browser, you can directly use the browser's built-in method to evoke sharing.
The specific implementation is here: http://feizhaojun.com/?p=761