0.0.8 • Published 3 years ago
cordova-plugin-app-switcher-privacy-cxm v0.0.8
cordova-plugin-screenprivacy-cxm
Installation
cordova plugin add cordova-plugin-app-switcher-privacy-cxm
For local setup
- clone the repository to cordova directory
- cordova plugin add ./cordova-plugin-app-switcher-privacy-cxm
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);
}