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

Screen

PDF
Focus Mode
Font Size
Last updated: 2025-02-24 17:10:36

setVisualEffectOnCapture

Notes:
This API is supported in mini programs but not in mini games.
This API is called using wx.setVisualEffectOnCapture(Object object).
Feature description:Sets the screen display when taking screenshots or recording the screen.(for Android only).
Parameter and description:Object object.
Property
Type
Default value
‍Required
Description
visualEffect
string
none
False
The visual effect during screenshot/recording. Supports none or hidden. Passing hidden will hide the screen during capture.
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).

setScreenBrightness

This API is called using wx.setScreenBrightness(Object object).
Feature description:Sets the screen brightness.
Parameter and description:Object object.
Property
Type
Default value
‍Required
Description
value
number
-
True
Screen brightness value, ranging from 0 (darkest) to 1 (brightest). On Android, supports a special value of -1, which means the screen brightness follows the system setting.
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).

setKeepScreenOn

This API is called using wx.setKeepScreenOn(Object object).
Feature description:Sets whether to keep the screen on. This setting only takes effect within the current mini program and will be invalid once you leave the mini program.
Parameter and description:Object object.
Property
Type
Default value
‍Required
Description
keepScreenOn
boolean
-
True
Whether to keep the screen on.
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.setKeepScreenOn({
keepScreenOn: true
})

onUserCaptureScreen

This API is called using wx.onUserCaptureScreen(function listener).
Notes:
This API is supported in mini programs but not in mini games.
Feature description:Listens for user-initiated screenshot event. It is triggered when the user takes a screenshot using the system screenshot button. Only one listener can be registered.
Parameter and description:function listener. The listener for user-initiated screenshot event.
Example:
wx.onUserCaptureScreen(function (res) {
console.log('User took a screenshot')
})

onScreenRecordingStateChanged

Notes:
This API is supported in mini programs but not in mini games.
This API is called using wx.onScreenRecordingStateChanged(function listener).
Feature description:Listens for user-initiated screen recording event.
Parameter and description:function listener. The listener for user-initiated screen recording event.
Property
Type
Description
state
string
Screen recording status. Valid values:
start: Screen recording started
stop: Screen recording stopped
Example:
// Listen for user-initiated screen recording event
const handler = function (res) {
console.log(res.state)
}
wx.onScreenRecordingStateChanged(handler)

// Cancel listening for user screen recording event
wx.offScreenRecordingStateChanged(handler)

offUserCaptureScreen

This API is called using wx.offUserCaptureScreen(function callback).
Notes:
This API is supported in mini programs but not in mini games.
Feature description: Cancels the listener for user-initiated screenshot event.
Parameter and description:function callback. The callback function for user-initiated screenshot event.

offScreenRecordingStateChanged

Notes:
This API is supported in mini programs but not in mini games.
This API is called using wx.offScreenRecordingStateChanged(function listener).
Feature description:Removes the listener for user-initiated screen recording event.
Parameter and description:function listener. The listener passed to onScreenRecordingStateChanged. If not provided, all listeners will be removed.
Example:
// Listen for user-initiated screen recording event
const handler = function (res) {
console.log(res.state)
}
wx.onScreenRecordingStateChanged(handler)

// Cancel listening for user screen recording event
wx.offScreenRecordingStateChanged(handler)
const listener = function (res) { console.log(res) }

wx.onScreenRecordingStateChanged(listener)
wx.offScreenRecordingStateChanged(listener) // Must pass the same function object used in onScreenRecordingStateChanged

getScreenRecordingState

Notes:
This API is supported in mini programs but not in mini games.
This API is called using wx.getScreenRecordingState(Object object).
Feature description:Queries whether the user is currently recording the screen.
Parameter and description:Object object.
Property
Type
Default value
‍Required
Description
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.success callback function parameter:Object res.
Property
Type
Description
state
string
Screen recording status. Valid values:
on: Enabled
off: Disabled
Example:
wx.getScreenRecordingState({
success: function (res) {
console.log(res.state)
},
})

getScreenBrightness

This API is called using wx.getScreenBrightness(Object object).
Notes:
If the automatic brightness adjustment feature is enabled in the Android system settings, the screen brightness will automatically adjust according to the light. This API can only obtain the value before the automatic brightness adjustment, not the real-time brightness value.
Feature description:Gets the screen brightness.
Parameter and description:Object object.
Property
Type
Default value
‍Required
Description
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.success callback function parameter:Object object.
Property
Type
Description
value
number
Screen brightness value, ranging from 0 (darkest) to 1 (brightest).




Help and Support

Was this page helpful?

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

Feedback