The MXCrashDiagnostic and MXHangDiagnostic reports are not being returned via MXMetricManager on the next app launch in iOS 17.2, 17.3, 17.4, and 17.5. This issue prevents collection of crash and hang diagnostics through the MetricKit framework, which worked as expected on earlier and later (18, 26) iOS versions.
Steps to Reproduce:-
- Integrate MetricKit in an iOS app using:
MXMetricManager.shared.add(self)
and implement:
func didReceive(_ payloads: [MXDiagnosticPayload])
- Install and run the app on a device running iOS 17.2 or later.
- Cause a crash or hang scenario (e.g., dereference a null pointer or block the main thread).
- Relaunch the app after the system terminates it.
- Observe the callback for diagnostic payloads.
Expected Behavior MXMetricManager.shared.didReceive(_:) should be invoked on the next launch, returning diagnostic payloads that include MXCrashDiagnostic or MXHangDiagnostic objects.
Actual Behavior: No diagnostics are returned on subsequent launches. didReceive(_:) is not triggered, or the diagnostic payloads array is empty.
This behavior is reproducible across multiple devices and iOS versions (17.2–17.5).
iOS Versions: 17.2, 17.3, 17.4, 17.5 Devices Tested: iPhone 14, iPhone 15 Pro Xcode Version: 15.2 / 15.3 Framework: MetricKit Diagnostic Type: Crash and Hang