capacitor-community / privacy-screen

⚡️ Capacitor plugin that protects your app from displaying a screenshot in Recents screen/App Switcher.
MIT License
88 stars 23 forks source link

bug: iOS PrivacyScreen.disable() not working #60

Closed benluria closed 1 year ago

benluria commented 1 year ago

Plugin version:

@capacitor-community/privacy-screen@4.1.0

Platform(s):

ios

Current behavior:

privacy screen is enabled by default. in app.component.ts, in platform.ready() handler:

PrivacyScreen.disable()
          .then(() => {
            console.log('privacy screen disabled');
          })
          .catch(err => console.error(err));

Screenshots are still blank.

Expected behavior:

after calling disable, screenshots would work normally. after calling enable, they would stop.

Steps to reproduce:

put this in app.component.ts on ready:

PrivacyScreen.disable()
          .then(() => {
            console.log('privacy screen disabled');
          })
          .catch(err => console.error(err));

observe log in console that there was no error. take a screenshot. its blank.

Other information:

Capacitor doctor: Latest Dependencies:

@capacitor/cli: 5.0.5 @capacitor/core: 5.0.5 @capacitor/android: 5.0.5 @capacitor/ios: 5.0.5

Installed Dependencies:

@capacitor/cli: 5.0.4 @capacitor/android: 5.0.4 @capacitor/core: 5.0.4 @capacitor/ios: 5.0.4

[success] iOS looking great!

robingenz commented 1 year ago

Thank you for your request. Please provide a Minimal, Reproducible Example using this template in a public GitHub repository so I can debug the issue.

dtarnawsky commented 1 year ago

The default for the plugin is that the privacy screen is enabled.

If you want it disabled by default then open capacitor.config.ts and add:

  plugins: {
    PrivacyScreen: {
      enable: false,
    },
  },

A sample application that does this is available at: https://github.com/dtarnawsky/cs-privacy-screen

github-actions[bot] commented 1 year ago

It looks like there hasn't been a reply in 30 days, so I'm closing this issue.