Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions docs/platforms/apple/common/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,31 @@ func applicationDidFinishLaunching() {
```
</PlatformSection>

<PlatformSection supported={[ "apple.macos"]}>

## Uncaught NSExceptions

On macOS, the Sentry Apple SDK can't capture uncaught exceptions out of the box, therefore we recommend enabling `enableUncaughtNSExceptionReporting` in your `SentryOptions`. Alternatively, you can use the `SentryCrashExceptionApplication` class. Please visit <PlatformLink to="/usage/#capturing-uncaught-exceptions">capturing uncaught exceptions</PlatformLink> for more information.

```swift {tabTitle:Swift}
import Sentry

SentrySDK.start { options in
options.dsn = "___PUBLIC_DSN___"
options.enableUncaughtNSExceptionReporting = true
}
```
```objc {tabTitle:Objective-C}
@import Sentry;

[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
options.dsn = @"___PUBLIC_DSN___";
options.enableUncaughtNSExceptionReporting = YES;
}];
```

</PlatformSection>

## Verify

Verify that your app is sending events to Sentry by adding the following snippet, which includes an intentional error. You should see the error reported in Sentry within a few minutes.
Expand Down Expand Up @@ -342,13 +367,6 @@ if (error) {
}
```

<PlatformSection supported={[ "apple.macos"]}>

## Uncaught Exceptions

On macOS, the Sentry Apple SDK can't capture uncaught exceptions out of the box. Please visit <PlatformLink to="/usage/#capturing-uncaught-exceptions">capturing uncaught exceptions</PlatformLink> for more information.

</PlatformSection>

## Next Steps

Expand Down
Loading