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.
Type
(callback: (res: CallbackResult) => void) => void
Parameters
Property | Type | Description |
---|---|---|
callback | (res: CallbackResult) => void | The 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
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
Taro.onUserCaptureScreen | ✔️ |