Skip to content

Commit a44da52

Browse files
feat(apple): Docs for resume and pause AppHangs (#10409)
* feat(apple): Docs for resume and pause AppHangs Add docs for resuming and pausing app hangs. * mention MetricKit * Update docs/platforms/apple/common/configuration/app-hangs.mdx Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> * Update docs/platforms/apple/common/configuration/app-hangs.mdx Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> * Update docs/platforms/apple/common/configuration/app-hangs.mdx Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> --------- Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com>
1 parent 1da0e56 commit a44da52

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

docs/platforms/apple/common/configuration/app-hangs.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ description: "Learn about how to add app hang detection reporting."
88

99
We recommend disabling this feature for Widgets and Live Activities because it might detect false positives.
1010

11+
Furthermore, the Cocoa SDK might report app hangs when the OS opens a system dialog asking for specific permissions,
12+
such as whether the user wants to allow your app to paste from the clipboard. As we can't reliably detect these scenarios,
13+
we advise you to [pause and resume tracking app hangs](#pause-and-resume-app-hang-tracking) to circumvent this problem.
14+
1115
</Note>
1216

1317
This integration tracks app hangs. This feature is available on iOS, tvOS, and macOS.
@@ -101,3 +105,31 @@ SentrySDK.start { options in
101105
}];
102106

103107
```
108+
109+
### Pause and Resume App Hang Tracking
110+
111+
Starting with version 8.30.0, you can pause and resume app hang tracking at runtime with `SentrySDK.pauseAppHangTracking()` and `SentrySDK.resumeAppHangTracking()`.
112+
These methods don't stop the <PlatformLink to="/configuration/metric-kit">MetricKit</PlatformLink> integration from reporting [MXHangDiagnostic](https://developer.apple.com/documentation/metrickit/mxhangdiagnostic).
113+
114+
```swift {tabTitle:Swift}
115+
import Sentry
116+
117+
SentrySDK.pauseAppHangTracking()
118+
119+
// Do something that might cause the app to hang,
120+
// and you don't want the Cocoa SDK to report it.
121+
122+
SentrySDK.resumeAppHangTracking()
123+
```
124+
125+
```objc {tabTitle:Objective-C}
126+
@import Sentry;
127+
128+
[SentrySDK pauseAppHangTracking];
129+
130+
// Do something that might cause the app to hang,
131+
// and you don't want the Cocoa SDK to report it.
132+
133+
[SentrySDK resumeAppHangTracking];
134+
135+
```

0 commit comments

Comments
 (0)