Detect screenshot with Ionic

Is there any way to detect when a user does a screenshot for Android and iOS? There is a cordova plugin for iOS ( only but I don’t know if it will work with Ionic.

Thanks in advance

It will. You just have to find out how to listen to a global event. might be enough.

1 Like


Did you get any luck with implementing this?

Tried both approaches but none of the is firing:

Approach 1:

import { Events } from 'ionic-angular';
..."screenshot", () => {

Approach 2:

declare let window;
window.addEventListener("screenshot", function() {
}, false);

In the case other viewer is getting problem detecting screenshot, here’s what works for me:

document.addEventListener('screenshot', function() {
}, false);