tencent cloud

Feedback

Customizing the Sharing Capability

Last updated: 2024-08-06 15:35:33
Developers can customize the buttons on the operation panel of the mini program,  including the sharing button and other buttons. The operation panel can be brought up by clicking the More button in the top right corner of the mini program:
@override
Future<List<CustomMenu>> getCustomMenus() async {
/// The menu contains menuId, image (local paths and network images are supported), menu name, and whether it is a custom sharing button.
CustomMenu menu1 = CustomMenu(
'100', 'res/images/mini_app_wechat_friend.png', 'Share To', true,
shareKey: 'twitter');
CustomMenu menu2 = CustomMenu(
'101', 'https://staticintl.cloudcachetci.com/cms/backend-cms/8WGP653_%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7%E9%80%9A%E7%94%A8.png', 'Custom', false);


return [
menu1,
menu2,
];
}
Menu click callback:
@override
Future<void> customMenuClick(String menuId, ShareData? shareMenu) async {
/// Callback for menu button click
print("click menuId:$menuId shareMenu:$shareMenu");
throw UnimplementedError();
}
The menu has built-in buttons for four sharing channels: QQ, Qzone, WeChat, and WeChat Circle of Friends. If you want to display these sharing buttons, you can configure them in the following ways.
_tcmppFlutterPlugin.defaultShareTargets([ShareTarget.qq, ShareTarget.wxMoment]);

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support