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: Screen remains black after closing/opening app #78

Closed reinventit closed 7 months ago

reinventit commented 1 year ago

Plugin version: 4.2.1

Platform(s): iOS (at least 16.4)

Current behavior: When closing the app and re-opening, the screen remains black.

Expected behavior: App should be renderend again

Steps to reproduce: Open app, close app and re-open again

Related code: It seems to be caused by the way modalPresentationStyle of the privacyViewController. It is currently set to 'overFullScreen' and this causes the underlaying view to be unloaded. If we change this to 'fullScreen' everything seems to be working.

Not working for me:

privacyViewController.modalPresentationStyle = UIModalPresentationStyle.overFullScreen

Working correctly for me:

privacyViewController.modalPresentationStyle = UIModalPresentationStyle.fullScreen

Other information:

Capacitor doctor:

πŸ’Š   Capacitor Doctor  πŸ’Š 

Latest Dependencies:

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

Installed Dependencies:

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

[success] iOS looking great! πŸ‘Œ
[success] Android looking great! πŸ‘Œ
robingenz commented 1 year ago

Hi, unfortunately I cannot reproduce your issue, see:

Bildschirmaufnahme 2023-11-06 um 17 40 39

reinventit commented 1 year ago

This seems to be different for iPhone / iPad.

Indeed everything works fine on the iPhone, but when I try the same with the iPad simulator the problem exists. Can you try and see if you can reproduce the issue when simulating an iPad?

robingenz commented 1 year ago

Thanks, i can reproduce this issue with iPadOS 16.4.

tobiloeb commented 9 months ago

Hi,

maybe I am facing the same issue on MacOS. With Plugin Version >= 4.0.0 an Capacitor 5, I am not able to use the App on MacOS anymore. The App opens correctly at startup, but with the first click anywhere, the App becomes black.

Can you reproduce this as well?

Regards Tobias

reinventit commented 9 months ago

Hi Tobias,

Maybe you can try of my PR fixes your issue as well?

https://github.com/reinventit/privacy-screen/tree/fix-black-screen

Regards, Rein

robingenz commented 8 months ago

Does the problem still exist with the latest version?

github-actions[bot] commented 7 months ago

It looks like there hasn't been a reply in 30 days, so I'm closing this issue.