Closed qliqdev closed 1 year ago
I suggest we start with a simple Capacitor Plugin Event Listener for detecting screenshots and leave the functionality to the app:
/**
* Listen for screen captures.
*
* Only available on iOS.
*/
addListener(
eventName: 'capturingDetected',
listenerFunc: () => void,
): Promise<PluginListenerHandle> & PluginListenerHandle;
/**
* Remove all listeners for this plugin.
*/
removeAllListeners(): Promise<void>;
I can imagine that not every user of the plugin wants this functionality. Maybe screenshots should be allowed despite the current privacy screen.
Sure, let me fix it today.
Sure, let me fix it today.
Build fails. is project.pbxproj
ok?
By the way should i change versions in package.json
from 3.0.1
to 3.0.2
?
By the way should i change versions in
package.json
from3.0.1
to3.0.2
?
No, thats not necessary.
@qliqdev Thank you for your contribution!
Thanks you, guys for doing this plugin.
i need "screenRecordingStarted" example code of JS version. help me. pls. i need detect screen recording on IOS.
my below code not working on iphone device.
PrivacyScreen.addEventListener( "screenRecordingStarted", function () { window.alert("Screen recording"); }, false );
Thanks.
Thanks you, guys for doing this plugin.
i need "screenRecordingStarted" example code of JS version. help me. pls.
i need detect screen recording on IOS.
my below code not working on iphone device.
**PrivacyScreen.addEventListener(
"screenRecordingStarted", function () { window.alert("Screen recording"); }, false
);**
Thanks.
Which iOS version you are using?
iOS version 16.0
iOS version 16.0
Looks like everything is ok.
this should be working
in your js/ts file:
await PrivacyScreen.addListener('screenRecordingStarted', async () => {
document.documentElement.classList.toggle(`is-capturing`, true);
});
await PrivacyScreen.addListener('screenRecordingStopped', async () => {
document.documentElement.classList.toggle(`is-capturing`, false);
});
in you global css file:
html.is-capturing{
-webkit-filter: blur(20px);
filter: blur(20px);
}
Above code working. 👍 Thank you sir.
Created new branch for one feature
detectCapturing