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: Webview not reactive on iOS after installation of the plugin from version 4.1.0 #84

Closed lhalleux closed 8 months ago

lhalleux commented 9 months ago

Plugin version:

All versions from 4.1.0 :

Platform(s):

Current behavior:

When we use a version from 4.1.0, the webkit view is not reactive, all actions aren't intercepted.

Expected behavior:

The webkit is reactive as it need to be

Steps to reproduce: Install a version of the privacy capacitor-community/privacy-screen from 4.1.0. Build the application and run it on a physical device or simulated one. Now you cannot be able to interact with the webview.

Related code:

After some debuggin, it seems to be the code that breaks the reactivity of the webview kit :

DispatchQueue.main.async {
            self.bridge?.webView?.disableScreenshots()
        }

Other information: None, do not hesitate to contact me if you need any specific informations.

Capacitor doctor:

Latest Dependencies:

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

Installed Dependencies:

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

[info] Using Gemfile: RubyGems bundle installed
[success] iOS looking great! 👌
[success] Android looking great! 👌
robingenz commented 9 months ago

Unfortunately there are several problems with the screenshot feature. I plan to revert it (see https://github.com/capacitor-community/privacy-screen/issues/76#issuecomment-1776551316) with the next major release (which should be published this month).

tafelnl commented 8 months ago

@robingenz With this PR (https://github.com/capacitor-community/privacy-screen/pull/87) you might want to reconsider that decision :)