Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@capacitor-community/privacy-screen

Package Overview
Dependencies
Maintainers
24
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capacitor-community/privacy-screen

Capacitor plugin that protects your app from displaying a screenshot in Recents screen/App Switcher.

  • 1.1.0-dev.5a6f254
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.2K
decreased by-13.46%
Maintainers
24
Weekly downloads
 
Created
Source


Privacy Screen

@capacitor-community/privacy-screen

Capacitor Privacy Screen Plugin


Introduction

⚡️ Capacitor plugin that protects your app from displaying a screenshot in Recents screen/App Switcher.

On Android, this plugin sets the FLAG_SECURE flag to treat the content of the window as secure, preventing it from appearing in screenshots or from being viewed on non-secure displays.
On iOS, this plugin hides the webview window when the app is no longer active and loses focus (UIApplicationWillResignActiveNotification) so that a gray screen is shown instead.

Maintainers

MaintainerGitHubSocial
Robin Genzrobingenz@robin_genz

Installation

npm install @capacitor-community/privacy-screen
npx cap sync

On iOS, no further steps are needed.

On Android, register the plugin in your main activity:

import com.getcapacitor.plugin.privacyscreen.PrivacyScreen;

public class MainActivity extends BridgeActivity {

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Initializes the Bridge
    this.init(
        savedInstanceState,
        new ArrayList<Class<? extends Plugin>>() {

          {
            // Additional plugins you've installed go here
            // Ex: add(TotallyAwesomePlugin.class);
            add(PrivacyScreen.class);
          }
        }
      );
  }
}

Configuration

No configuration required for this plugin.

Usage

The plugin only needs to be installed. The protection is enabled by default. However, you have the option to enable/disable the protection:

import { Plugins } from '@capacitor/core';
import '@capacitor-community/privacy-screen';

const enable = async () => {
  await Plugins.PrivacyScreen.enable();
};

const disable = async () => {
  await Plugins.PrivacyScreen.disable();
};

Changelog

See CHANGELOG.md.

Keywords

FAQs

Package last updated on 31 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc