We want to disable all Screenshot/Screen Recording capabilities of the app so that this information will be protected, but do not know how to accomplish this using Xcode.
Currently, we are able to detect when a screenshot/screen record is about to take place and we clear the screen and have an alert popup letting the user know that they cannot take images/video of the information displayed on screen, but the problem is that it happens immediately after the screenshot happens. So the images always have the image of the screen and the first frame or so of the screen recording is the screen as well.
We are using an observer for UIScreen.capturedDidChangeNotification
in the AppDelegate
to do this, but it still isn’t what we are looking for. What we want is that when the app detects the state of capturing to be about to change, the screen to go blank so that the image/video will only be of a blank screen instead of the unobscured information.
NotificationCenter.default.addObserver(forName: UIScreen.capturedDidChangeNotification, object: nil, queue: OperationQueue.main)