title: Taro.onUserCaptureScreen(callback)

sidebar_label: onUserCaptureScreen

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

  1. (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

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

API Support

API WeChat Mini-Program H5 React Native
Taro.onUserCaptureScreen ✔️