cordova-cxm-prevent-appsnapshot
v0.0.8
Published
Cordova plugin to handle app switcher visibility
Downloads
2
Maintainers
Readme
cordova-plugin-screenprivacy-cxm
Installation
cordova plugin add cordova-cxm-prevent-appsnapshot
For local setup
- clone the repository to cordova directory
- cordova plugin add ./cordova-cxm-prevent-appsnapshot
Note: in android there is no callback from system when app pushed to recently opened apps. The feature implemented is using lifecycle method of android activity (onPause and onResume) to create a work around system which is might not work in some devices refer this for more details
Usage
document.addEventListener("deviceready", onDeviceReady, false);
// To enable screenshot
function onDeviceReady() {
window.plugins.appswitcher.unblock(successCallback, errorCallback);
}
// To block screenshot
function onDeviceReady() {
window.plugins.appswitcher.block(successCallback, errorCallback);
}
// {"message": "success message"}
function successCallback(result) {
console.log(result);
}
// {"message": "failure message"}
function errorCallback(error) {
console.log(error);
}