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: App freezed after google auth webview #77

Closed EduVeco closed 8 months ago

EduVeco commented 1 year ago

Plugin version: plugin version: 4.2.1

Platform(s):

Ionic:

Ionic CLI : 6.20.1 Ionic Framework : not installed @angular-devkit/build-angular : 16.2.6 @angular-devkit/schematics : 16.2.6 @angular/cli : 16.2.6 @ionic/angular-toolkit : 9.0.0

Capacitor:

Capacitor CLI : 5.4.2 @capacitor/android : 5.4.2 @capacitor/core : 5.4.2 @capacitor/ios : 5.4.2

Current behavior: Using codetrix google auth plugin, after google auth window shows, and back to the app, i can´t interact with the app, buttons and scrolling are locked,

Some details: To see the google auth window, i have to disable the PrivacyScreen and the enable such as the documentation mention with the camera app

Expected behavior: i need to interact with my app after enable the PrivacyScreen

Steps to reproduce: I noticed that this just happens with IOS 17, in android, the plugin works as we expected Ionic 7, capacitor 5 and https://github.com/CodetrixStudio/CapacitorGoogleAuth plugin, this error is similar to the @capacitor/share

Privacy.disable() then google auth code from plugin, after the google webview load, and returning to the app, the app will be freezed

Capacitor doctor: Latest Dependencies:

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

Installed Dependencies:

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

robingenz commented 1 year ago

Does it work with plugin version 4.0.0?

EduVeco commented 1 year ago

I´ve just tried, with this version my app don´t get freezed but I can make screenshots in IOS

robingenz commented 1 year ago

Yes, this feature is currently causing problems.

renekroll commented 1 year ago

We have encountered similar problems which result when opening native dialogs (@capacitor/share and image upload (quill editor)). It looks like the package does not recognize when native dialogs are closed. After closing, there seems to be an invisible dialog over the app.

https://github.com/capacitor-community/privacy-screen/assets/38501755/2f707ad3-2f35-4d2c-a874-70f709a24aff

@robingenz Do you see a possible fix?

robingenz commented 1 year ago

@renekroll For now, I recommend to downgrade to version 4.0.0.

renekroll commented 1 year ago

@robingenz thanks, the problem is, with version 4.0.0 and ios 17.x the plugin is not working.

robingenz commented 1 year ago

@renekroll I'll take a closer look once it's clear if we're reverting the screenshot feature on iOS (see https://github.com/capacitor-community/privacy-screen/issues/76#issuecomment-1776551316).

mschmermer commented 1 year ago

@robingenz Hello, although I'm not deeply familiar with the topic, I rely on the feature to prevent screenshots. Is it possible to make the overlay that appears over the app disappear with a single click? This would mean that the image freezes during a screenshot but can be removed by clicking on it. It's just an idea since I don't fully understand the current problem.

I know that would be a Problem with screen records.

EduVeco commented 1 year ago

you also can

@robingenz thanks, the problem is, with version 4.0.0 and ios 17.x the plugin is not working.

you also can use the API and plattform library to activate privacy screen just for android

robingenz commented 1 year ago

@mschmermer From my POV, this would be a workaround with a bad UX. I can't invest more than a few hours in debugging at the moment. However, PRs are always welcome. If someone finds a solution, I would be very happy.

mschmermer commented 1 year ago

I go with you that is defently a workaround. But on this way the user doesnt need to relaunch the App be hard close the app.