You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: platform-includes/enriching-events/attach-screenshots/apple.mdx
+35Lines changed: 35 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -13,3 +13,38 @@ SentrySDK.start { options in
13
13
options.attachScreenshot=YES;
14
14
}];
15
15
```
16
+
17
+
### Customize Screenshot Capturing
18
+
19
+
<Note>
20
+
21
+
Requires Cocoa SDK version `8.27.0` or higher.
22
+
23
+
</Note>
24
+
25
+
26
+
The `beforeCaptureScreenshot` also allows you to customize the behavior based on event data, so you can decide when to capture a screenshot and when not to. The callback doesn't work for crash events.
27
+
28
+
```swift {tabTitle:Swift}
29
+
import Sentry
30
+
31
+
SentrySDK.start { options in
32
+
options.dsn = "___PUBLIC_DSN___"
33
+
options.beforeCaptureScreenshot = { event in
34
+
// Return false to not capture a screenshot for the event.
0 commit comments