cordova-plugin-blurred-snapshot
Version:
Cordova Plugin for blurring app when it will resign active and removes it when app did become active.
52 lines (34 loc) • 1.66 kB
Markdown
Use this plugin to keep sensitive information from views before moving to the background.
[](https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH4-SW8.)
Made with WWDC 2013 [UIImage+ImageEffects](https://developer.apple.com/library/ios/samplecode/UIImageEffects/Listings/UIImageEffects_UIImageEffects_h.html#//apple_ref/doc/uid/DTS40013396-UIImageEffects_UIImageEffects_h-DontLinkElementID_8)
iOS 8 [UIBlurEffect](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIBlurEffect_Ref/) is less configurable(No API for Radius)

cordova-ios platform >= 4.0.0
```
cordova plugin add cordova-plugin-blurred-snapshot
```
```
cordova plugin add https://github.com/trykovyura/cordova-plugin-blurred-snapshot.git
```
Depends on application events: "pause" and "resume".
Apply plugin method "addBlurredSnapshot" on "pause" to add blurred snapshot for app.
Apply plugin method "removeBlurredSnapshot" on "resume" to remove blurred snapshot.
```
document.addEventListener('pause', onPause, false);
document.addEventListener('resume', onResume, false);
function onPause() {
blurredsnapshot.addBlurredSnapshot();
}
function onResume() {
blurredsnapshot.removeBlurredSnapshot();
}
```
iOS only. Tested in iOS7+, might work on older iOS versions
MIT License