capacitor-community / privacy-screen

⚡️ Capacitor plugin that protects your app from displaying a screenshot in Recents screen/App Switcher.
MIT License
75 stars 19 forks source link

Question: how can I set custom image? #91

Open Pierlu1586 opened 2 weeks ago

Pierlu1586 commented 2 weeks ago

Hi everyone! I'm trying to add a custom image but I always see black screen when I take a screenshot on IOS device. Currently I have my custom image in "myProject/ios/App/App/Assets.xcassets/Splash.imageset/customImage.png" and I have edited capacitor.config.json (path: myProject/ios/App/App/capacitor.config.json) with:

    "PrivacyScreen": {
            "enable": false,
            "useImageBackground": true,
            "imageName": "customImage"
        }

Some informations. I'm working on an angular/ionic project and I'm using capacitor-community/privacy-screen v.5.0.0 I change "enable" property in specific pages of my application.

Where am I doing wrong? Any suggestions?

Thanks

robingenz commented 2 weeks ago

Here you can find an example on how to use the imageName configuration property: https://github.com/robingenz/capacitor-plugin-demo/tree/main

Pierlu1586 commented 1 week ago

Thank you @robingenz for your answer. I have created a new imageset folder for my custom image (with Contents.json e customImage.png) and I have changed capacitor.config.json. Now I see my custom image in the upper-right corner but when I take screenshot I get black screen. :(

https://github.com/capacitor-community/privacy-screen/assets/52927087/83aa11b2-a99f-4e3e-878c-f68e30efe3a2

robingenz commented 1 week ago

Please provide a Minimal, Reproducible Example using this template in a public GitHub repository so I can debug the issue.