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: not correctly handling optional imageName #80

Closed reinventit closed 1 year ago

reinventit commented 1 year ago

Plugin version: 4.2.1

Platform(s): iOS (16.4)

Current behavior: If no imageName is given, then this results in errors (and not showing the gray overlay

Expected behavior: No imageName (or empty one) should default to gray overlay on iOS

Steps to reproduce: Provide no imageName in configuration, app switcher shows white view (and debugger gives errors because of missing image)

Related code: Not working

if let imageName = config.imageName {

Working

if let imageName = config.imageName, !imageName.isEmpty {

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! 👌