Session Replay
Generates: Screenshot frame data
Captures periodic screenshots and uploads them in a periodic way.
Enabling Session Replay
Session replay is enabled and configured from the Pulse dashboard via Remote Config — not from initialize(). This lets you roll out replay gradually, and adjust capture settings without shipping an app update.
From the dashboard you can enable or disable session replay, and configure text & input privacy and image privacy strategies.
What You Configure in Code
The only thing you need to do in code is mark sensitive views that should always be masked or always be shown, regardless of the remote privacy setting.
Per-Class Masking
Mask or unmask all instances of a given UIView subclass. Set this in the sessionReplay config block if you need to initialize with defaults before remote config arrives:
config.sessionReplay { replay in
replay.configure { cfg in
cfg.maskViewClasses = ["MyCustomSensitiveView"]
cfg.unmaskViewClasses = ["MyPublicBannerView"]
}
}
Per-View Masking
UIKit:
// Always mask this view
sensitiveLabel.pulseReplayMask()
// Always show this view (overrides a global maskAll setting)
avatarImageView.pulseReplayUnmask()
SwiftUI:
Text("Card number: 4242 ...")
.pulseReplayMask()
Image("avatar")
.pulseReplayUnmask()
Or via accessibilityIdentifier:
view.accessibilityIdentifier = "pulse-mask" // always masked
view.accessibilityIdentifier = "pulse-unmask" // always shown
Privacy Modes
These are the available text and image privacy settings, configurable from the dashboard:
Text and Input
| Value | Behavior |
|---|---|
.maskAll | All text — labels, inputs, hints — replaced with blocks (default) |
.maskAllInputs | Only editable inputs masked; static labels shown |
.maskSensitiveInputs | Only password, email, phone inputs masked |
Images
| Value | Behavior |
|---|---|
.maskAll | All images replaced with a solid rectangle (default) |
.maskNone | Images shown as-is |
Consent
Session replay respects the SDK-level dataCollectionState. When .pending, no screenshots are captured. When consent transitions to .allowed, capture resumes automatically. See Data Collection Consent.
Resource Usage
| Concern | Default behavior |
|---|---|
| CPU | Screenshots taken on a background thread — UI is not blocked |
| Memory | Frames batched in memory up to maxBatchSize, then flushed to disk |
| Disk | Persisted to Caches directory; cleared after successful upload |
| Network | Compressed JPEG/WebP frames — lower compressionQuality to reduce payload size |