cordova-cxm-prevent-appsnapshot

0.0.8 • Public • Published

cordova-plugin-screenprivacy-cxm

Installation

cordova plugin add cordova-cxm-prevent-appsnapshot

For local setup

  1. clone the repository to cordova directory
  2. 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);
}

Package Sidebar

Install

npm i cordova-cxm-prevent-appsnapshot

Weekly Downloads

2

Version

0.0.8

License

MIT

Unpacked Size

10.7 kB

Total Files

8

Last publish

Collaborators

  • grpranava