Home  >  Article  >  Backend Development  >  How is the success of capturing WeChat sharing actions called back?

How is the success of capturing WeChat sharing actions called back?

WBOY
WBOYOriginal
2016-12-01 00:25:171650browse

1. I can now share updates to my circle of friends, but why is the alert in success not executed after the sharing is completed? I don’t quite understand how to get this callback? Haven't used it before.

2. The code is as follows
wx.ready(function() {
wx.onMenuShareTimeline({
title: 'shareonweb', // Share title
link: 'http://www.baidu.com', // Share link
imgUrl: 'http://www.mengchunyingxiang....', // Share icon
success: function() {
//alert('1');

alert('Sharing successful');
// Callback function executed after the user confirms sharing
},
cancel: function() {
//alert('2');

alert('Sharing failed');
//Callback function executed after the user cancels sharing
},
fail: function (res) {
//alert('3');

alert(res);
};
});
});

Reply content:

1. I can now share updates to my circle of friends, but why is the alert in success not executed after the sharing is completed? I don’t quite understand how to get this callback? Haven't used it before.

2. The code is as follows
wx.ready(function() {
wx.onMenuShareTimeline({
title: 'shareonweb', // Share title
link: 'http://www.baidu.com', // Share link
imgUrl: 'http://www.mengchunyingxiang....', // Share icon
success: function() {
//alert('1');

alert('Sharing successful');
// Callback function executed after the user confirms sharing
},
cancel: function() {
//alert('2');

alert('Sharing failed');
//Callback function executed after the user cancels sharing
},
fail: function (res) {
//alert('3');

alert(res);
};
});
});

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn