What is the app switcher screenshot vulnerability on iOS, and what API call should a developer make to mitigate it for screens displaying sensitive financial data?
- A.A) iOS does not take screenshots for the app switcher; the vulnerability only affects Android
- B.B) When an app transitions to the background, iOS captures a screenshot of the current screen for the app switcher. Sensitive data (account numbers, balances) may be visible. The mitigation is to observe UIScene.willDeactivateNotification (or applicationWillResignActive) and overlay an opaque view or set the window to hidden before the snapshot is taken, then remove it in applicationDidBecomeActive
- C.C) Setting UIScreen.main.brightness = 0 before backgrounding prevents the screenshot capture
- D.D) Declaring NSScreenCaptureUsageDescription in Info.plist prevents iOS from taking app switcher screenshots
Why B is correct