capacitor-community / privacy-screen

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

bug: this is not working It also prevents screenshots (a black screen will be captured) [ios] #63

Closed hashemalkayal closed 1 year ago

hashemalkayal commented 1 year ago

Plugin version: @capacitor-community/privacy-screen: "4.1.1" @capacitor/core: "5.0.5",

Platform(s): IOS

Current behavior: when i try take screen shot from ios device is show my app screen instead black screen

Expected behavior: black screen instead my app screen

Steps to reproduce:

Related code:

const preventScreenshot = async (): void => { await PrivacyScreen.enable(); };

if (platform !== 'web') preventScreenshot();

insert short code snippets here

Other information:

Capacitor doctor:

insert the output from `npx cap doctor` here
robingenz commented 1 year ago

I cannot reproduce the issue using this demo app on my iPhone 13 with iOS 16.5.1. Please provide a Minimal, Reproducible Example using this template in a public GitHub repository so I can debug the issue.

hashemalkayal commented 1 year ago

@robingenz

i created new project and i faced the same issue as well

github : https://github.com/hashemalkayal/demo-app-capacitor

robingenz commented 1 year ago

Just to make sure I didn't misunderstand you: The screenshot shows your app screen but you expect a black screen, right?

hashemalkayal commented 1 year ago

@robingenz

Yes, sure. That's what I mean

robingenz commented 1 year ago

Sorry, i still can't reproduce your issue, see:

https://github.com/capacitor-community/privacy-screen/assets/13857929/60bc705d-aae1-4122-a091-e74b20461ee8

The screenshot is black.

Edit: Thats your app.But with the plugin activated, you only see black in the recording.

hashemalkayal commented 1 year ago

@robingenz

just when you call -- Privacy Screen.enable();

see black screen no extra configurations on ios platform ?

robingenz commented 1 year ago

Yeah, I used your example app.

hashemalkayal commented 1 year ago

My iPhone 14 with iOS version 16.2

on app switcher mode my screen is replaced with gray color (correct behvior)

but when i try take screenshot i can see my app screen (incorrect behavior)

robingenz commented 1 year ago

I understand that but I can't reproduce the problem and thus can't debug it. You are welcome to debug it yourself and create a PR with a fix.