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

Keyboard triggers privacy enable #40

Closed gbkwiatt closed 1 year ago

gbkwiatt commented 2 years ago

From Android 12, it seems like when keyboard opens, it triggers privacy screen enable.

I disable it on app load, and on screen recording everything shows fine until keyboard opens, it goes black.

Works all fine without plugin.

so concluition, looks like plugin enables itself when keyboard opens

robingenz commented 2 years ago

Hi @gbkwiatt, thank you for your request. I could not reproduce the problem. Please provide a Minimal, Reproducible Example (see How to create a Minimal, Reproducible Example) so i can debug the issue.

gbkwiatt commented 2 years ago

I am sorry, but there is not much to reproduce. I have VueApp, on app load, I disable privacy plugin as I only need it in one place. Was working all fine, until some latest updates (could be android update to 12 too). And when I have text input that triggers native keyboard to open, privacy screen is enabled. I can observe it by recording screen on my device, and when keyboard is triggered, video goes black.

When I remove plugin, everything works fine.

robingenz commented 2 years ago

As I said, unfortunately I can't reproduce it and therefore I can't debug it. I mark the issue as help wanted. Maybe someone else can reproduce and debug it.

gbkwiatt commented 2 years ago

I am happy to debug it myself, could you suggest anything, what would be the best to check ?

robingenz commented 2 years ago

To be honest, I don't know. I also don't know if there is a fix here at all. On Android, only the FLAG_SECURE flag is set (see https://github.com/capacitor-community/privacy-screen/blob/e812e57242c38546124dacc76e4c0b3caee186b3/android/src/main/java/com/getcapacitor/plugin/privacyscreen/PrivacyScreenPlugin.java#L53). Here you cannot configure anything etc. Android handles this completely on its own.

gbkwiatt commented 2 years ago

Ah yeah I can see not much there then. So what it means, somehow, plugins is initialised again. But I've just realised, it happens when I use vue-portal, and that triggers plugin to re-initialize somehow

robingenz commented 1 year ago

Okay, in that case it doesn't seem to be a problem with the plugin. I will close this issue.