Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: screenshotMode typo #143

Merged
merged 3 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
## Next

- recording: fix `screenshotMode` typo ([#143](https://github.com/PostHog/posthog-android/pull/143))

## 3.5.0 - 2024-06-11

- chore: change host to new address ([#139](https://github.com/PostHog/posthog-ios/pull/139))
- fix: rename groupProperties to groups for capture methods ([#140](https://github.com/PostHog/posthog-ios/pull/140))
- recording: add `screenhshotMode` option for session replay instead of wireframe ([#142](https://github.com/PostHog/posthog-android/pull/142))
- recording: add `screenshotMode` option for session replay instead of wireframe ([#142](https://github.com/PostHog/posthog-android/pull/142))

## 3.4.0 - 2024-05-23

Expand Down
10 changes: 5 additions & 5 deletions PostHog/Replay/PostHogReplayIntegration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
let style = RRStyle()

// no parent id means its the root
if parentId == nil, config.sessionReplayConfig.screenhshotMode {
if parentId == nil, config.sessionReplayConfig.screenshotMode {
if let image = view.toImage() {
wireframe.base64 = imageToBase64(image)
}
Expand Down Expand Up @@ -304,12 +304,12 @@

var screenName: String?
if let controller = window.rootViewController {
// SwiftUI only supported with screenhshotMode
if controller is AnyObjectUIHostingViewController, !config.sessionReplayConfig.screenhshotMode {
hedgeLog("SwiftUI snapshot not supported, enable screenhshotMode.")
// SwiftUI only supported with screenshotMode
if controller is AnyObjectUIHostingViewController, !config.sessionReplayConfig.screenshotMode {
hedgeLog("SwiftUI snapshot not supported, enable screenshotMode.")
return
// screen name only makes sense if we are not using SwiftUI
} else if !config.sessionReplayConfig.screenhshotMode {
} else if !config.sessionReplayConfig.screenshotMode {
screenName = UIViewController.getViewControllerName(controller)
}
}
Expand Down
2 changes: 1 addition & 1 deletion PostHog/Replay/PostHogSessionReplayConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/// The screenshot may contain sensitive information, use with caution.
/// Experimental support
/// Default: false
@objc public var screenhshotMode: Bool = false
@objc public var screenshotMode: Bool = false

// TODO: sessionRecording config such as networkPayloadCapture, captureConsoleLogs, sampleRate, etc
}
Expand Down
2 changes: 1 addition & 1 deletion PostHogExample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AppDelegate: NSObject, UIApplicationDelegate {
config.debug = true
config.sendFeatureFlagEvent = false
config.sessionReplay = true
config.sessionReplayConfig.screenhshotMode = true
config.sessionReplayConfig.screenshotMode = true

PostHogSDK.shared.setup(config)
PostHogSDK.shared.debug()
Expand Down
10 changes: 5 additions & 5 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ If any of the breaking changes are blocking you, please [open an issue](https://

Enable `Record user sessions` on the [PostHog project settings](https://us.posthog.com/settings/project-replay#replay).

Requires the iOS SDK version >= [3.3.0-alpha.1](https://github.com/PostHog/posthog-ios/releases/).
Requires the iOS SDK version >= [3.5.0](https://github.com/PostHog/posthog-ios/releases/).

Enable the SDK to capture Session Recording.

Expand All @@ -214,18 +214,18 @@ config.sessionReplay = true
config.sessionReplayConfig.maskAllTextInputs = true
config.sessionReplayConfig.maskAllImages = true
config.sessionReplayConfig.captureNetworkTelemetry = true
// screenhshotMode is disabled by default
// screenshotMode is disabled by default
// The screenshot may contain sensitive information, use with caution
config.sessionReplayConfig.screenhshotMode = true
config.sessionReplayConfig.screenshotMode = true
```

If you don't want to mask everything, you can disable the mask config above and mask specific views using the `ph-no-capture` [accessibilityIdentifier](https://developer.apple.com/documentation/uikit/uiaccessibilityidentification/1623132-accessibilityidentifier).

### Limitations

- [SwiftUI](https://developer.apple.com/xcode/swiftui/) is only supported if the `screenhshotMode` option is enabled.
- [SwiftUI](https://developer.apple.com/xcode/swiftui/) is only supported if the `screenshotMode` option is enabled.
- It's a representation of the user's screen, not a video recording nor a screenshot.
- Custom views are not fully supported.
- If the option `screenhshotMode` is enabled, the SDK will take a screenshot of the screen instead of making a representation of the user's screen.
- If the option `screenshotMode` is enabled, the SDK will take a screenshot of the screen instead of making a representation of the user's screen.
- WebView is not supported, a placeholder will be shown.
- React Native and Flutter for iOS aren't supported.
Loading