Good news:
2020-07-07, the mini program starts to support sharing to Moments (only available on Android phones).
(Learning video sharing: Introduction to Programming)
Test model: Xiaomi 9 miui12 20.7.2 WeChat version 7.0.16
Experience address: Scan the QR code to enter the mini program----Click the three dots in the upper right corner
Technical Official Account
Look at the case first
WeChat development documentation:
https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability /share-timeline.html
https://developers.weixin.qq.com/miniprogram/dev/reference/api/Page.html#onShareTimeline
https://developers.weixin .qq.com/miniprogram/dev/api/share/wx.showShareMenu.html
Code
//index.js //获取应用实例 const app = getApp() Page({ data: { }, onLoad: function () { wx.showShareMenu({ menus: ['shareAppMessage', 'shareTimeline'], success(res) { console.log(res) }, fail(e) { console.log(e) } }) }, onShareAppMessage(){ }, onShareTimeline(){ } })
My WeChat LJT-917
Related recommendations: Mini program development tutorial
The above is the detailed content of How to share mini program to Moments. For more information, please follow other related articles on the PHP Chinese website!