如何在Appsee分析中隐藏警报标题及时间线内的敏感警报标题与消息?
I’ve dealt with this exact Appsee quirk before—nice call using +(void)markViewAsSensitive:(UIView*)view to hide the alert in your recordings, but you’re right that this API only handles the visual part, not the timeline metadata. Let’s fix that:
The Root Issue
markViewAsSensitive only obscures or hides the view in the screen recording. Appsee automatically captures alert events (including title and message) as separate timeline entries via its default auto-tracking, which is why those sensitive details are still showing up even after hiding the view.
Step-by-Step Fix
Turn off automatic alert capture
First, disable Appsee’s default alert tracking so you control exactly what gets logged to the timeline:[Appsee setAutoCaptureAlerts:NO];Add this line early in your app setup (like
application:didFinishLaunchingWithOptions:) before any alerts are presented.Manually log non-sensitive alerts
For alerts without confidential data, explicitly log them with the details you want to keep:// Example non-sensitive alert UIAlertController *safeAlert = [UIAlertController alertControllerWithTitle:@"Update Available" message:@"Tap to install the latest version" preferredStyle:UIAlertControllerStyleAlert]; // Log to Appsee timeline [Appsee logEvent:@"Alert Presented" withParameters:@{ @"Title": safeAlert.title, @"Message": safeAlert.message }]; // Present the alert normally [self presentViewController:safeAlert animated:YES completion:nil];Handle sensitive alerts properly
For alerts with confidential info, you have two solid options:- Skip logging entirely: Don’t call
logEventfor these alerts—they won’t appear in the timeline at all. - Redact sensitive details: If you need to track that an alert was shown but don’t want to expose secrets, replace the title/message with generic placeholders:
// Example sensitive alert UIAlertController *confidentialAlert = [UIAlertController alertControllerWithTitle:@"Account Warning" message:@"Your SSN has been updated" preferredStyle:UIAlertControllerStyleAlert]; // Keep using markViewAsSensitive to hide it in recordings [Appsee markViewAsSensitive:confidentialAlert.view]; // Log a redacted entry (optional) [Appsee logEvent:@"Sensitive Alert Presented" withParameters:@{ @"Title": @"[Sensitive Content]", @"Message": @"[Sensitive Content]" }]; // Present the alert [self presentViewController:confidentialAlert animated:YES completion:nil];
- Skip logging entirely: Don’t call
Quick Note for Older iOS Versions
If you’re using UIAlertView instead of UIAlertController, the same logic applies: disable auto-capture, manually log only safe alerts, and mark sensitive alert views with markViewAsSensitive.
内容的提问来源于stack exchange,提问作者NoliNik

