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

Question: how can I set custom image? #91

Closed Pierlu1586 closed 3 months ago

Pierlu1586 commented 4 months 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 4 months 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 4 months 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 4 months ago

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

ZhipengZeng commented 4 months ago

@robingenz
The splash screen displays correctly when switching the app. Can we have a custom image for screenshot instead of a black screen?

robingenz commented 4 months ago

@ZhipengZeng Your request is not related to this issue. Please create a separate feature request.

github-actions[bot] commented 3 months ago

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

louis123562 commented 2 months ago

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

Hey guys, where exactly in your link do i find the documentation on how to generate the images / imageset for the custom image, which should be displayed in the app (on ios), when putting the app in background? It would als be very great if this would be in the docs of the plugin... not anywhere else.