H5 secondary page Share

For H5 page is secondary share is still quite important, after all, after qq or micro sent the letter comes habits of sharing. And different PC side, PC directly copy the address. Two days before making invitations, stepped on a lot of thunder, personal development and the development of the company is not the same, problems, other problems in a postscript inside invitation to speak. We start the topic.

Micro-channel secondary share

Micro-channel document is good. Throughout the reading, basically you can avoid a lot of the pit ( remember the micro-channel document used to put some pits written on the back, and hold together )

Let us talk about, how to do the second micro letter how to share

Document addresses , through the introduction of the official API. Document write very good, directly into the shareInfohave to.

<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
wx.config({
    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
    appId: sign.appid, // 必填,公众号的唯一标识
    timestamp: sign.timestamp, // 必填,生成签名的时间戳
    nonceStr: sign.nonceStr, // 必填,生成签名的随机串
    signature: sign.signature, // 必填,签名,见附录1
    jsApiList: [
            'onMenuShareTimeline',
            'onMenuShareAppMessage',
            'onMenuShareQQ',
            'onMenuShareWeibo',
            'onMenuShareQZone'
        ] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function() {
    wx.showOptionMenu();
    wx.onMenuShareAppMessage(shareInfo); //获取“分享给朋友”按钮点击状态及自定义分享内容接口(即将废弃)
    wx.onMenuShareTimeline(shareInfo); //获取“分享到朋友圈”按钮点击状态及自定义分享内容接口(即将废弃)
    wx.onMenuShareQQ(shareInfo); //获取“分享到QQ”按钮点击状态及自定义分享内容接口
    wx.onMenuShareWeibo(shareInfo); //获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口
    wx.onMenuShareQZone(shareInfo); //获取“分享到QQ空间”按钮点击状态及自定义分享内容接口
});

Micro-channel secondary share pit it?

Ugh? I wrote a how not to pass? The document did not write down what requirements it?

View first micro-channel public platform - Development - Interface authority found no privileges are not prompted to obtain, and then to carry out micro-certified letter, prompted me to share the interface has received it. What do you say? Micro-channel can go back to view the documents are generally described. Is the following sentence, then the question becomes, can not do the personal number is authenticated.

IOS and Android are unable to share (make sure the public has been certified number, only certified public number that has the authority to share relevant interface, if it has been certified, will have to check whether the listener interface trigger in wx.ready callback function)

clipboard.png

About api tone finishing unreasonable error

  1. invalid url domain( Reference link ), my question is js security domain did not engage in
  2. invalid url signature( Reference link ), my question is jsapi_ticketnot updated over
  3. JS micro-channel interfaces signature verification tool

QQ secondary share

Let me talk about the document

Documents circulated on the Internet, what api, and I tried to do so. Go through the address, the last 15 years, what are the maintenance.

How to set up a secondary share

By meta tag is the most scientific.

<meta itemprop="name" content="标题" />
<meta itemprop="image" content="副标题" />
<meta name="description" itemprop="description" content="分享图" />

Is there anything I should know

The meta tag can not be added later, when there is a need to enter the page, that can only go backstage template. Otherwise, some Androidlower version than pulling summary (yes, some phones dynamic can get), iOSdoes not support.

In fact, there are technical articles aging

This article was written on July 30, 2018

Test Time July 30, 2018

Guess you like

Origin www.cnblogs.com/homehtml/p/11875599.html