[BREAKGLASS] Obscure passwords and other sensitive personal information when a react-native app transitions to the background
Go to file
2015-10-07 15:31:21 +11:00
RCTPrivacySnapshot base with blur. 2015-10-07 15:26:42 +11:00
RCTPrivacySnapshot.xcodeproj base with blur. 2015-10-07 15:26:42 +11:00
.gitignore base with blur. 2015-10-07 15:26:42 +11:00
index.js base with blur. 2015-10-07 15:26:42 +11:00
package.json base with blur. 2015-10-07 15:26:42 +11:00
readme.md base with blur. 2015-10-07 15:26:42 +11:00
screenshot1.png base with blur. 2015-10-07 15:26:42 +11:00
screenshot2.png base with blur. 2015-10-07 15:26:42 +11:00

Enable privacy snapshot for React Native

In the App Programming Guide for iOS, Apple says:

When an app transitions to the background, the system takes a snapshot of the apps main window, which it then presents briefly when transitioning your app back to the foreground. Before returning from your applicationDidEnterBackground: method, you should hide or obscure passwords and other sensitive personal information that might be captured as part of the snapshot.

This react-native module obscure passwords and other sensitive personal information when an app transitions to the background.

PrivacySnapshot.enabled(false)

Screenshot of the multi-tasking screen

PrivacySnapshot.enabled(true)

Screenshot of the multi-tasking screen with privacy screenshot

Installation iOS

  1. Run npm install react-native-privacy-snapshot --save in your project directory
  2. Open your project in XCode, right click on Libraries and click Add Files to "Your Project Name"
  3. Within node_modules, find react-native-privacy-snapshot and add RCTPrivacySnapshot.xcodeproj to your project.
  4. Add libRTCPrivacySnapshot.a to Build Phases -> Link Binary With Libraries

Usage

let PrivacySnapshot = require('react-native-privacy-snapshot');

...

  componentWillMount() {
    PrivacySnapshot.enabled(true);
  },

  componentWillUnmount() {
    PrivacySnapshot.enabled(false);
  },