Getting Started
Notify your Capacitor app after the user takes a screenshot.
Use the event for post-capture guidance or in-app UI updates (for example a toast or analytics log). The notification arrives after a screenshot is taken; it does not protect or blur content before capture.
Install
npm install @rdlabo/capacitor-screenshot-event
npx cap sync
Usage
See ScreenshotEvent to register a listener, start watching, confirm one physical screenshot on a device, then stop and remove the handle.
Platform notes
- iOS: Uses the
UIApplication.userDidTakeScreenshotNotificationnotification. - Android (8.0.0): Watches
FileObserver.CREATEon the fixed pathPictures/Screenshots/under external storage. Detection depends on screenshots being saved to that directory; it is not a MediaStore change observer and is not guaranteed on every Android device or OEM gallery path. - Web: Not supported because browsers do not expose screenshot events.