Skip to content

Commit

Permalink
feat(iOS): add new session replay config (#15)
Browse files Browse the repository at this point in the history
* feat(iOS): add new session replay config

* chore: update CHANGELOG

* fix: use config defaults
  • Loading branch information
ioannisj authored Nov 26, 2024
1 parent e019a5c commit 35770c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Next

- fix: mask sandboxed system views like photo picker and user library photos

## 0.1.7 - 2024-11-19

- fix: respects the flushAt flag
Expand Down
12 changes: 9 additions & 3 deletions ios/PosthogReactNativeSessionReplay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,23 @@ class PosthogReactNativeSessionReplay: NSObject {
config.debug = debug
config.sessionReplayConfig.screenshotMode = true

let maskAllTextInputs = sdkReplayConfig["maskAllTextInputs"] as? Bool ?? false
let maskAllTextInputs = sdkReplayConfig["maskAllTextInputs"] as? Bool ?? true
config.sessionReplayConfig.maskAllTextInputs = maskAllTextInputs

let maskAllImages = sdkReplayConfig["maskAllImages"] as? Bool ?? false
let maskAllImages = sdkReplayConfig["maskAllImages"] as? Bool ?? true
config.sessionReplayConfig.maskAllImages = maskAllImages

let maskAllSandboxedViews = sdkReplayConfig["maskAllSandboxedViews"] as? Bool ?? true
config.sessionReplayConfig.maskAllSandboxedViews = maskAllSandboxedViews

let maskPhotoLibraryImages = sdkReplayConfig["maskPhotoLibraryImages"] as? Bool ?? true
config.sessionReplayConfig.maskPhotoLibraryImages = maskPhotoLibraryImages

let iOSdebouncerDelayMs = sdkReplayConfig["iOSdebouncerDelayMs"] as? Int ?? 1000
let timeInterval: TimeInterval = Double(iOSdebouncerDelayMs) / 1000.0
config.sessionReplayConfig.debouncerDelay = timeInterval

let captureNetworkTelemetry = sdkReplayConfig["captureNetworkTelemetry"] as? Bool ?? false
let captureNetworkTelemetry = sdkReplayConfig["captureNetworkTelemetry"] as? Bool ?? true
config.sessionReplayConfig.captureNetworkTelemetry = captureNetworkTelemetry

let endpoint = decideReplayConfig["endpoint"] as? String ?? ""
Expand Down

0 comments on commit 35770c7

Please sign in to comment.