cordova-plugin-prevent-screenshot
Cordova Prevent Screenshots
Last updated 4 years ago .
· Repository · Original npm · Tarball · package.json
$ cnpm install cordova-plugin-prevent-screenshot 
SYNC missed versions from official npm registry.

cordova-plugin-prevent-screenshot

This is a cordova plugin to enable/disable screenshots in android

Plugin works in Ionic

Supported Platforms

  • Android API all versions

Installation

Cordova local build: cordova plugin add <GIT URL PATH>

Usage in javascript

document.addEventListener("deviceready", onDeviceReady, false);
// Enable
function onDeviceReady() {
  window.plugins.preventscreenshot.enable(successCallback, errorCallback);
}
// Disable
function onDeviceReady() {
  window.plugins.preventscreenshot.disable(successCallback, errorCallback);
}

function successCallback(result) {
  console.log(result); // true - enabled, false - disabled
}

function errorCallback(error) {
  console.log(error);
}

Usage in typescript


// Enable
  (<any>window).plugins.preventscreenshot.enable((a) => this.successCallback(a), (b) => this.errorCallback(b));

// Disable
  (<any>window).plugins.preventscreenshot.disable((a) => this.successCallback(a), (b) => this.errorCallback(b));

  successCallback(result) {
    console.log(result); // true - enabled, false - disabled
  }

  errorCallback(error) {
    console.log(error);
  }

Current Tags

  • 1.0.3                                ...           latest (4 years ago)

4 Versions

  • 1.0.0                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
Maintainers (1)
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright © npmmirror.com | 浙ICP备15033595号-63 |