Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to convert Mini Program to get forwarding information

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, the editor would like to share with you the relevant knowledge points about how Mini Program can be transformed into retweeted information. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article, let's take a look at it.

Forward

When using Mini Game, users can forward messages to other users or group chat.

Forward menu

Click the button in the upper right corner, the menu will pop up, the "forward" option in the menu is not displayed by default. You can dynamically show and hide this option through wx.showShareMenu and wx.hideShareMenu.

Passive forwarding

When a user clicks the "forward" option in the upper right menu, a forwarding event is triggered. If Mini Game listens to this event through wx.onShareAppMessage, you can modify the content of the forwarded card by returning custom forwarding parameters, otherwise the default content is used.

Exampl

Wx.onShareAppMessage () = > {

/ / the user clicked the forward button

Return {

Title: 'forward header'

}

})

Active forwarding interface

You can directly call up the forwarding interface through the wx.shareAppMessage interface in the game. Similar to passive forwarding, you can customize the content of the forwarding card.

Exampl

Wx.shareAppMessage ({

Title: 'forward header'

})

WithShareTicket mode

The forwarding attribute can be modified through the wx.updateShareMenu API. If you set withShareTicket to true, you will have the following effect

When selecting a contact, you can only select one target, not more than one.

After the message is forwarded, it cannot be forwarded twice in the session window.

If the target of message forwarding is a group chat, then

Will get a shareTicket when the forwarding is successful.

Each time a user enters from this message card, he will also get a shareTicket, and the group-related information can be obtained by passing in shareTicket by calling the wx.getShareInfo API. Click on more introduction to WeChat Mini Programs development tutorials.

Exampl

/ / set withShareTicket: true

Wx.updateShareMenu ({

WithShareTicket: true

})

These are all the contents of the article "how Mini Program can be transformed to get retweeted messages". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report