Block and Unblock Screenshots
You can also use the iOS SDK to block screenshots from being taken during the execution of a code block. This just temporarily blocks screenshots from being taken until you unblock screenshots. This enables you to stop taking screenshots in situations where users are entering personal data, such as on login and account screens.
The ADEumInstrumentation class provides the methods blockScreenshots and unblockScreenshots to block and unblock screenshots. If screenshots are disabled through the property screenshotsEnabled of the ADEumAgentConfiguration object or through the Controller UI, these methods have no effect. You can also call screenshotsBlocked to check if screenshots are being blocked.
- Objective-C
-
PYTHON
#import "ADEumInstrumentation.h" ... - (IBAction)loginUser:(id)sender { if(![ADEumInstrumentation screenshotsBlocked]) { [ADEumInstrumentation blockScreenshots]; } LoginCredentials creds = [UserLogin getUserCreds]; if(creds.authorized) { [LoginUser redirectToProfile:creds.user] [ADEumInstrumentation unblockScreenshots]; } } ... - Swift
-
JAVASCRIPT
import ADEumInstrumentation ... @IBAction func loginUser(_ sender: UIButton) { if(!ADEumInstrumentation.screenshotsBlocked()) { ADEumInstrumentation.blockScreenshots() } let creds = UserLogin.getUserCreds() if(creds.authorized) { LoginUser.redirectToProfile(credits.user) ADEumInstrumentation.unblockScreenshots() } } ...