From 5044bb27e39ef352abc512e8aa5b99a0ac950415 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Wed, 22 Oct 2025 15:10:14 +1300 Subject: [PATCH 01/52] Added ability to set ReplayOptions for Cocoa --- samples/Sentry.Samples.Maui/MauiProgram.cs | 6 ++- src/Sentry/Platforms/Cocoa/SentryOptions.cs | 47 +++++++++++++++++++++ src/Sentry/Platforms/Cocoa/SentrySdk.cs | 12 ++++++ 3 files changed, 63 insertions(+), 2 deletions(-) diff --git a/samples/Sentry.Samples.Maui/MauiProgram.cs b/samples/Sentry.Samples.Maui/MauiProgram.cs index 1a8a6a30a7..a749b2b855 100644 --- a/samples/Sentry.Samples.Maui/MauiProgram.cs +++ b/samples/Sentry.Samples.Maui/MauiProgram.cs @@ -44,20 +44,22 @@ public static MauiApp CreateMauiApp() // Automatically create traces for async relay commands in the MVVM Community Toolkit options.AddCommunityToolkitIntegration(); -#if __ANDROID__ - // Currently, experimental support is only available on Android +#if __ANDROID__ || __IOS__ || __MACCATALYST__ + // Experimental support for Session Replay is currently available on Android, iOS and Mac Catalyst. options.Native.ExperimentalOptions.SessionReplay.OnErrorSampleRate = 1.0; options.Native.ExperimentalOptions.SessionReplay.SessionSampleRate = 1.0; // Mask all images and text by default. This can be overridden for individual view elements via the // sentry:SessionReplay.Mask XML attribute (see MainPage.xaml for an example) options.Native.ExperimentalOptions.SessionReplay.MaskAllImages = true; options.Native.ExperimentalOptions.SessionReplay.MaskAllText = true; +#if __ANDROID__ // Alternatively, the masking behaviour for entire classes of VisualElements can be configured here as // an exception to the default behaviour. // WARNING: In apps with complex user interfaces, consisting of hundreds of visual controls on a single // page, this option may cause performance issues. In such cases, consider applying the // sentry:SessionReplay.Mask="Unmask" attribute to individual controls instead. options.Native.ExperimentalOptions.SessionReplay.UnmaskControlsOfType