Screen recording detection
iOS only. Android offers no reliable signal on the versions the SDK
supports, so the Android answers are null and no events fire.
Check the current state
Section titled “Check the current state”final recorded = await DeviceShield.isScreenRecorded();// true / false on iOS, null where it can't be determined (Android)Get notified of changes
Section titled “Get notified of changes”DeviceShield.screenRecordingChanges.listen((isRecorded) { // isRecorded: recording or mirroring started (true) or stopped (false)});Events fire only when the state changes. There’s no initial event, so call
isScreenRecorded() once when your screen opens.
What counts as “recorded”
Section titled “What counts as “recorded””The SDK reads UIScreen.isCaptured, which is true during screen recording,
AirPlay mirroring, and when an external display mirrors the screen. It can’t
tell these apart.