iOS: Prevent Screenshot Or Prevent Record Screen

Tram Ho

I. The problem

Our team encountered a problem is how to prevent users from taking screenshots or recording videos on iOS. Of course, it eliminates cases like using another camera to shoot or take pictures. After a bit of research, my group came to this conclusion. Of course, if anyone has a solution, our group wants to absorb it.

II. Block screenshots

At the present time, our team found out that the result is almost 100% unable to stop the screenshot on iOS.
The team has devised some methods or has tried many manuals based on the documentation but still failed.

1. allowScreenShot

https://www.emergingdefense.com/blog/2019/2/4/ios-secure-development-guide
(page 73) https://developer.apple.com/business/documentation/Configuration-Profile-Reference.pdf

Our team tried it and didn’t see results.

2. Retouch the image after taking it

https://developer.apple.com/documentation/uikit/uiapplication/1622966-userdidtakescreenshotnotificatio
https://developer.apple.com/documentation/photokit/phphotolibrary

Use userDidTakeScreenshotNotification and PHPhotoLibrary notifications.

  • Use observer to capture event, after taking picture.
  • After shooting, use PHPhotoLibrary, to proceed to access the photo to change the image just taken.

Result:

  • It is possible to change the image just taken but the app always displays an alert confirm. So this is not 100% satisfactory.

III. Block filming

1. capturedDidChangeNotification

https://developer.apple.com/documentation/uikit/uiscreen/2921652-captureddidchangenotification

Use notification capturedDidChangeNotification and UIScreen.main.isCaptured. Note that only applies from iOS 11 and above.

The result: based on those events we can process the processing of sensitive information. Although it is not possible as Netfix or HBO, it is still considered to be acceptable.

2. FairPlay Streaming

Document:
https://developer.apple.com/streaming/fps/

Secure the delivery of streaming media to devices through the HTTP Live Streaming (HLS) protocol. Using FairPlay Streaming (FPS) technology, content providers, encoding vendors, and delivery networks can encrypt content, securely exchange keys, and protect playback on iOS, tvOS, and macOS.

This SDK, my team has not had the opportunity to test, but according to research, it seems to only apply to video streaming and need to contact Apple for Apple favor.

IV. Other

In addition to the above, the team also has research at https://screenshieldkit.com . Check out the demo it looks. However, it seems one thing my team does not trust this SDK very much. Because all blog posts from 2018 and earlier, no technology companies use, no public Price and also find out on https://stackoverflow.com . Someone commented that, it also uses FairPlay Streaming.

V. Conclusion

The group only made blocking screen rotation, while blocking taking pictures almost gave up on iOS. It is difficult for iOS but Android seems to be more advantageous with support from API 1.

Some sources:
https://developer.apple.com/business/documentation/Configuration-Profile-Reference.pdf
https://www.emergingdefense.com/blog/2019/2/4/ios-secure-development-guide
https://screenshieldkit.com
https://medium.com/nomtek/screenshot-preventing-on-mobile-apps-9e62f51643e9
https://github.com/hawkup/react-native-prevent-screenshot
https://www.netguru.com/codestories/how-to-prevent-users-from-taking-screenshots

Share the news now

Source : Viblo