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

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

WBOY
Release: 2023-03-01 14:58:01
Original
1733 people have browsed it

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);
};
});
});

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template