Skip to content

Release v1.3.1

Choose a tag to compare

@ketanmixpanel ketanmixpanel released this 13 Mar 19:14
· 11 commits to main since this release
74880d2

What's Changed

autoMaskedViews can now be updated at runtime, allowing you to dynamically control which view types are masked based on the current screen or user flow. For example, you can expand masking coverage when entering a sensitive screen and restore the original configuration on exit.

// Cache original autoMaskedViews config
var originalMaskedViews  = MPSessionReplay.getInstance()?.autoMaskedViews

// Expand masking on a sensitive screen
MPSessionReplay.getInstance()?.autoMaskedViews = [.text, .image]

// Restore original config on exit
MPSessionReplay.getInstance()?.autoMaskedViews = originalMaskedViews

Example usage for Swift UI actionsheet

    Section {
        Button(action: {
            self.showActionSheet.toggle()
        }) {
            Text("Show ActionSheet")
        }
        .actionSheet(isPresented:  $showActionSheet) {
            ActionSheet(title: Text("Showing ActionSheet"),
                        message: Text("This is Message"),
                        buttons: [Alert.Button.default(Text("OK")),
                                  Alert.Button.cancel(),
                                  Alert.Button.destructive(Text("Delete"))])
        }.onChange(of: showActionSheet) { oldValue, newValue in
            if newValue {
                MPSessionReplay.getInstance()?.autoMaskedViews = [.text]
            } else {
                MPSessionReplay.getInstance()?.autoMaskedViews = []
            }
        }
    }