下面方式测试无效,没有收到回调。 [代码]onShareAppMessage: [代码][代码]function[代码] [代码](ops) {[代码][代码] [代码][代码]if[代码] [代码](ops.from === [代码][代码]'button'[代码][代码]) {[代码][代码] [代码][代码]// 来自页面内转发按钮[代码][代码] [代码][代码]console.log(ops.target)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]var[代码] [代码]title = [代码][代码]this[代码][代码].data.title;[代码][代码] [代码][代码]return[代码] [代码]{[代码][代码] [代码][代码]title: title ? title : [代码][代码]'小白群管理助手'[代码][代码],[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]// 转发成功[代码][代码] [代码][代码]console.log(res[代码][代码]);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]// 转发失败[代码][代码] [代码][代码]console.log(res[代码][代码]);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码]但是经过测试发现,你如果点击分享小程序,在app.js中可以拿到: [代码]onShow: [代码][代码]function[代码] [代码](ops){[代码][代码] [代码][代码]console.log([代码][代码]"APP-每次启动"[代码][代码]);[代码][代码] [代码][代码]if[代码] [代码](ops.shareTicket) {[代码][代码] [代码][代码]wx.getShareInfo({[代码][代码] [代码][代码]shareTicket: ops.shareTicket,[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log(res);[代码][代码] [代码][代码]// { errMsg: "getShareInfo:ok", iv: "OJX/PX3nna0HHVID9zw==", encryptedData: "Vtnj6nlqduHBWFJKYSyKh4yHDMPuU1Hs7l6iPQCNMZ6U4qCstX…vk2HiraBektRNdOkxHi0FgGVkgSxwQxWz2LQrw==" }[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码](res) {[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]complete: [代码][代码]function[代码] [代码](res) {[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码]当别人点击你转发的小程序,就可以获取到了。
onShareAppMessage 回调问题报错 转发成功不打印回调,为什么[图片]
2019-07-31下面方式测试无效,没有收到回调 [代码]onShareAppMessage: [代码][代码]function[代码] [代码](ops) {[代码][代码] [代码][代码]if[代码] [代码](ops.from === [代码][代码]'button'[代码][代码]) {[代码][代码] [代码][代码]// 来自页面内转发按钮[代码][代码] [代码][代码]console.log(ops.target)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]var[代码] [代码]title = [代码][代码]this[代码][代码].data.title;[代码][代码] [代码][代码]return[代码] [代码]{[代码][代码] [代码][代码]title: title ? title : [代码][代码]'小白群管理助手'[代码][代码],[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]// 转发成功[代码][代码] [代码][代码]console.log(res[代码][代码]);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]// 转发失败[代码][代码] [代码][代码]console.log(res[代码][代码]);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码] 但是经过测试发现,你如果点击分享小程序,在app.js中可以拿到: [代码]onShow: [代码][代码]function[代码] [代码](ops){[代码][代码] [代码][代码]console.log([代码][代码]"APP-每次启动"[代码][代码]);[代码][代码] [代码][代码]if[代码] [代码](ops.shareTicket) {[代码][代码] [代码][代码]wx.getShareInfo({[代码][代码] [代码][代码]shareTicket: ops.shareTicket,[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log(res);[代码][代码] [代码][代码]// { errMsg: "getShareInfo:ok", iv: "OJX/PX3nna0HHVID9zw==", encryptedData: "Vtnj6nlqduHBWFJKYSyKh4yHDMPuU1Hs7l6iPQCNMZ6U4qCstX…vk2HiraBektRNdOkxHi0FgGVkgSxwQxWz2LQrw==" }[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码](res) {[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]complete: [代码][代码]function[代码] [代码](res) {[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码]当别人点了你转发的小程序,就可以获取到了。
onShareAppMessage的回调问题描述:微信关闭了onShareAppMessage的回调,但是需求是:想要知道用户转发成功,来做下一步的业务。 - 希望提供的能力: 寻求方法解决。 致谢
2019-07-31