-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: enable() immediately shows privacy layer, app unusable #73
Comments
Thank you for your request. |
Hello, Simulator.Screen.Recording.-.iPhone.15.Pro.-.2023-10-03.at.10.14.07.mp4 |
I did this without splash and had the same results that the screen is blanked out. Help me understand. When I call enable() is it supposed to show the privacy screen immediately? The documentation suggests that you use enable to protect against screenshots and view in the switcher if the user tries to take a screenshot/use the switcher. So, enable() = "wait until a screenshot is taken or the switcher is shown and then show privacy screen". Right? Because when I call enable() it IMMEDIATELY blanks my screen, which seems incorrect to me. But, maybe I misunderstand. Do I need to add listeners and then only call enable() when the listeners are triggered? "enable" to me != "show". It "enables" protection. Here is a screen recording where I show it disabled first, then enabled second, all without imageName specified in the config (no splash) (Oh, and the docs don't really show how to specify a splash image. What size is used and how is it scaled? Do we just put it in the app's asset folder and then just give it the plain name to it? PrivacyScreen.mov |
On this video you posted it is working as it should. They grey screen you get it is because you didnt add splashscreen. The privacy screen is visible only when app isnt active (in recent). If you put img name splash, than it will use splash screen of the app if you have one. I generated splash screen with capacitor-assets plugin. |
Yes, it does seem to be working for "recents"/"switcher". But it's NOT preventing screenshots. I couldn't care less about the switcher. I NEED to prevent screenshots. How do you prevent a screenshot with this plugin? |
I will take a look at it in the next few days. |
I close this issue as duplicate of #74. |
Plugin version:
^4.2.0
Platform(s):
iOS/Android
Current behavior:
Upon calling PrivacyScreen.enable() the privacy layer is immediately displayed making the app unusable.
Expected behavior:
The privacy layer should only be shown when the user is trying to take a screenshot, screen recording, or viewing the task switcher.
Steps to reproduce:
Sample Repo
Related code:
See this file in the repo on line 20 where PrivacyScreen.enable() is called.
Capacitor doctor:
The text was updated successfully, but these errors were encountered: