Skip to content

Commit

Permalink
feat: Support enableNativeCrashHandling for iOS (#2101)
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored Mar 4, 2022
1 parent 221d270 commit 42a4e82
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## Unreleased

- feat: Support enableNativeCrashHandling for iOS #2101
- Bump: Sentry Cocoa 7.10.0 #2100

## 3.2.14-beta.2
Expand Down
11 changes: 11 additions & 0 deletions ios/RNSentry.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ + (BOOL)requiresMainQueueSetup {
reject(@"SentryReactNative", error.localizedDescription, error);
return;
}

if ([mutableOptions valueForKey:@"enableNativeCrashHandling"] != nil) {
BOOL enableNativeCrashHandling = (BOOL)[mutableOptions valueForKey:@"enableNativeCrashHandling"];

if (!enableNativeCrashHandling) {
NSMutableArray *integrations = sentryOptions.integrations.mutableCopy;
[integrations removeObject:@"SentryCrashIntegration"];
sentryOptions.integrations = integrations;
}
}

[SentrySDK startWithOptionsObject:sentryOptions];

// If the app is active/in foreground, and we have not sent the SentryHybridSdkDidBecomeActive notification, send it.
Expand Down

0 comments on commit 42a4e82

Please sign in to comment.