it-dgc-verificaC19-ios icon indicating copy to clipboard operation
it-dgc-verificaC19-ios copied to clipboard

Do not allow screenshot when the certificate info is visible

Open astagi opened this issue 3 years ago • 3 comments

Describe the bug

User can perform a screenshot when certificate info are shown on the screen

Expected behaviour

Do not allow screenshot when the certificate info is visible

Steps to reproduce the issue

Scan a certificate, then try to perform a screenshot

Technical details

  • Host Machine OS: iOS

astagi avatar Jun 22 '21 14:06 astagi

Unlike Android, is not possible to prevent screenshots on iOS, since Apple doesn’t provide any native method.

Apple provides only these functionalities to prevent/interact with screenshots:

  1. Textfield with “Secure Text Entry” attribute.
This attribute is usually checked by the developer in password textfields. In this case iOS natively hide the content during screenshots or screen recordings.
  2. NotificationCenter
Subscribing on “UIApplication.userDidTakeScreenshotNotification” events the developer can know if the user has taken a screenshot, but this is a post-event info
  3. FairPlay Streaming 
This functionality prevents taking screenshots or recording screen during a video streaming. (It is used from apps like Netflix). Only the streaming is obfuscated (black screen) but the UI is visible on the screenshot.

Another third party technology is ScreenShieldKit, that should wrap the FairPlay Streaming functionality, dealing views like streaming videos.

So, I think we shouldn't consider this app behavior as a bug

andreaprosseda avatar Jun 24 '21 12:06 andreaprosseda

That's clear @Andrea-Prosseda . The first solution looks great, but we should prevent screenshots on the camera activity. To generally solve this problem why not delete the last saved image of the taken screenshot after the userDidTakeScreenshotNotification event? It may require additional permission but it looks to be the only workaround possible.

astagi avatar Jun 24 '21 16:06 astagi

Does the UIApplication.userDidTakeScreenshotNotification also fire when a screen recording is on? Also, if the user starts recording before opening the app and ends it after closing the app, the video won't be deleted.

gianpispi avatar Aug 04 '21 13:08 gianpispi

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 22 '23 12:03 stale[bot]