Skip to main content
Version: 3.x

Taro.onUserCaptureScreen(callback)

Listens on the event that the user actively takes screenshots. It is triggered when the user uses the screenshot button of the system to take a screenshot.

Reference

Type

(callback: (res: CallbackResult) => void) => void

Parameters

PropertyTypeDescription
callback(res: CallbackResult) => voidThe callback function for the event that the user actively takes screenshots.

Sample Code

Taro.onUserCaptureScreen(function (res) {
console.log('User took a screenshot')
})

API Support

APIWeChat Mini-ProgramH5React Native
Taro.onUserCaptureScreen✔️