Skip to content
rdlabo.dev

ScreenshotEvent

ScreenshotEvent watches for screenshot activity. Call this after Installation. Register addListener before startWatchEvent so the first screenshot is not missed.

addListener

import { ScreenshotEvent } from '@rdlabo/capacitor-screenshot-event';

const handle = await ScreenshotEvent.addListener('userDidTakeScreenshot', () => {
  // Notice take screenshot
});

await handle.remove();

startWatchEvent

import { ScreenshotEvent } from '@rdlabo/capacitor-screenshot-event';

ScreenshotEvent.addListener('userDidTakeScreenshot', () => {
  // Notice take screenshot
});

ScreenshotEvent.startWatchEvent();

removeWatchEvent

import { ScreenshotEvent } from '@rdlabo/capacitor-screenshot-event';

ScreenshotEvent.removeWatchEvent();

Signatures are on the API page.