tencent cloud

Tencent Cloud Super App as a Service

Release Notes and Announcements
Announcement: Tencent Cloud Mini Program Platform Renamed to Tencent Cloud Super App as a Service on January 2, 2025
Console Updates
Android SDK Updates
iOS SDK Updates
Flutter SDK Updates
IDE Updates
Base Library Updates
Product Introduction
Overview
Strengths
Use Cases
Purchase Guide
Billing Overview
Pay-As-You-Go Billing
Renewal Guide
Service Suspension Instructions
Getting Started
Plan Management
Overview
Console Account Management
Storage Configuration
Acceleration Configuration
Branding Configurations
Platform Features
Console Login
Users and Permission System
Mini Program Management
Mini Game Management
Superapp Management
Commercialization
Platform Management
User Management
Team Management
Operations Management
Security Center
Code Integration Guide
Getting Demo and SDK
Android
iOS
Flutter
Superapp Server
GUID Generation Rules
Mini Program Development Guide
Mini Program Introduction and Development Environment
Mini Program Code Composition
Guide
Framework
Components
API
Server Backend
JS SDK
Base Library
IDE Operation Instructions
Mini Game Development Guide
Guide
API
Server Backend
Practice Tutorial
Mini Program Login Practical Tutorial
Mini Program Subscription Message Practical Tutorial
Payment Practical Tutorial
Ad Integration Practical Tutorial
Mini Game Subscription Message Practical Tutorial
API Documentation
History
Introduction
API Category
Making API Requests
Operation Management APIs
User Management APIs
Team Management APIs
Sensitive API-Related APIs
Role Management APIs
Platform Management APIs
Other Console APIs
Mini Program or Mini Game APIs
Management-Sensitive APIs
Global Domain Management APIs
Superapp APIs
Data Types
Agreements
Service Level Agreement
Data Processing and Security Agreement
SDK Privacy Policy Module
SDK Data Processing and Security Agreement Module

Share

PDF
Focus Mode
Font Size
Last updated: 2025-08-06 18:16:52

hideShareMenu

This API is called using wx.hideShareMenu (Object object).
Feature description: Hide the specified "Share" button in the upper-right corner more menu.
Parameter and description: Object object.
Property
Type
Default value
‍Required
Description
hideShareItems
Array.<string>
-
False
For the list of names of the "Share" buttons that need to be hidden, please check below object.hideShareItems parameter and description, and after the superapp has customized the sharing capability, the value shall be subject to shareKey.
success
function
-
False
Callback function for successful API calls.
fail
function
-
False
Callback function for failed API calls.
complete
function
-
False
Callback function executed after API call ends (regardless of success or failure).
object.hideShareItems parameters
Value
Description
'wechatFriends'
WeChat Contacts
'wechatMoment'
WeChat Moments
'qq'
QQ Contacts
'qzone'
QQ Zone
Example:
wx.hideShareMenu({
hideShareItems: ['wechatFriends', 'wechatMoment']
})

showShareMenu

This API is called using wx.showShareMenu (Object object).
Feature description:Display the specified "Share" button in the upper-right corner more menu.
Parameter and description:Object object.
Property
Type
Default value
‍Required
Description
showShareItems
Array.<string>
-
False
For the list of names of the "Share" buttons that need to be displayed, please check below object.showShareItems parameter and description, and after the superapp has customized the sharing capability, the value shall be subject to shareKey.
success
function
-
False
Callback function for successful API calls.
fail
function
-
False
Callback function for failed API calls.
complete
function
-
False
Callback function executed after API call ends (regardless of success or failure).
object.showShareItems parameters
Value
Description
'wechatFriends'
WeChat Contacts
'wechatMoment'
WeChat Moments
'qq'
QQ Contacts
'qzone'
QQ Zone
Example:
wx.showShareMenu({
showShareItems: ['wechatFriends', 'wechatMoment']
})

showShareImageMenu

This API is called using wx.showShareImageMenu (Object object).
Note:
This API is supported in mini programs but not in mini games.
Feature description: Opens a share image dialog to download the image.
Parameter and description: Object object.
Property
Type
Default value
‍Required
Description
path
string
-
True
The local or temporary path of the image to share.
success
function
-
False
Callback function for successful API calls.
fail
function
-
False
Callback function for failed API calls.
complete
function
-
False
Callback function executed after API call ends (regardless of success or failure).
Example:
wx.downloadFile({
url: 'https://res.wx.qq.com/wxdoc/dist/assets/img/demo.ef5c5bef.jpg',
success: (res) => {
wx.showShareImageMenu({
path: res.tempFilePath
})
}
})

onShareAppMessage

This API is called using wx.onShareAppMessage(function listener)
Note:
This API is only supported in mini games.
Feature description: Listens for the event triggered when the user taps the "Share" button in the top-right menu.
Parameter and description:
function listener, the function that listens for event triggered when the user taps the "Share" button in the top-right menu.
Object res,
Property
Type
Description
title
string
Share title. If not passed, the nickname of the current mini-game will be used by default.
imageUrl
string
The link of the image displayed for sharing can be a network image path, a local image file path, or an image file path relative to the root directory of the code package.
query
string
The query string must be in the format of key1=val1&key2=val2. After entering from this shared message, you can obtain the query in the launch parameters through wx.getLaunchOptionsSync() or wx.onShow().
path
string
Independent subpackage path. For details, see mini game independent subpackages.
Example:
wx.onShareAppMessage(() => {
return {
title: 'Share Title',
imageUrl: '' // Image URL
query: 'name=1&phone=2'
}
})

onCopyUrl

This API is called using wx.onCopyUrl(function listener).
Note:
This API is supported in mini programs but not in mini games.
Feature description:Listens for the event triggered when the user taps the "Copy URL" button in the top-right menu.
Parameter and description:
The function that listens for event triggered when the user taps the "Copy URL" button in the top-right menu.
Object res,
Property
Type
Description
query
string
The query string carried by the current page when opened with a short link. When using this in a mini program, you should call wx.onCopyUrl to customize the query when entering the page and call wx.offCopyUrl when exiting the page to prevent affecting other pages.
Example:
// Bind the shared parameters
wx.onCopyUrl(() => {
return { query: 'a=1&b=2' }
})

// Unbind the shared parameters
wx.offCopyUrl()


offCopyUrl

This API is called using wx.offCopyUrl().
Note:
This API is supported in mini programs but not in mini games.
Feature description:Removes all listeners for event triggered when the user taps the "Copy URL" button in the top-right menu.
Example:
// Bind the shared parameters
wx.onCopyUrl(() => {
return { query: 'a=1&b=2' }
})

// Unbind the shared parameters
wx.offCopyUrl()






Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback