-
Notifications
You must be signed in to change notification settings - Fork 153
Closed
Labels
awaiting responseWaiting for response / confirmation from the reporterWaiting for response / confirmation from the reporter
Description
UIAlertController RUM tracking is fundamentally not working in the iOS SDK. Neither automatic view tracking via predicate nor manual view management can properly isolate alert actions from the parent view.
Steps to Reproduce:
- Configure UIKitRUMViewsPredicate to return a RUMView for UIAlertController
- Present an alert with accessibilityIdentifier set
- User taps alert button
- Check Datadog RUM dashboard
Actual Behavior:
- Alert view is created and tracked separately
- Button tap actions are mapped to the parent view instead of the alert view
- This creates a disconnect between the view hierarchy and action tracking
Environment:
- SDK Version: 2.29.0
- iOS Version: iOS 18.0+
- Device: iPhone
- Xcode Version: 16.3
Code Example:
class CustomRUMViewPredicate: UIKitRUMViewsPredicate {
func rumView(for viewController: UIViewController) -> RUMView? {
if let alert = viewController as? UIAlertController,
let label = alert.view.accessibilityIdentifier,
let viewName = ScreenNameManager.shared.getAlertName(alert: label) {
return RUMView(name: viewName) // Returns valid RUMView
}
// Fallback for regular screens
guard let viewName = ScreenNameManager.shared.getScreenName(for: viewController) else {
return nil
}
return RUMView(name: viewName)
}
}
// Usage:
let alert = UIAlertController(title: "Test", message: "Message", preferredStyle: .alert)
alert.view.accessibilityIdentifier = "TestAlert"
alert.addAction(UIAlertAction(title: "OK", style: .default) { _ in
// This action gets tracked under parent view, not "TestAlert"
})
present(alert, animated: true)
Metadata
Metadata
Assignees
Labels
awaiting responseWaiting for response / confirmation from the reporterWaiting for response / confirmation from the reporter