Skip to content

Commit

Permalink
fix(crashlytics, ios): generate uncatchable crash for iOS crash testi…
Browse files Browse the repository at this point in the history
…ng (#4426)

Previous solutions to test crashing not being reported did not work in either or both of debug and release
  • Loading branch information
RyogaK authored Oct 21, 2020
1 parent fe31805 commit 2dcaad5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ + (BOOL)requiresMainQueueSetup {
RCT_EXPORT_METHOD(crash) {
if ([RNFBCrashlyticsInitProvider isCrashlyticsCollectionEnabled]) {
// https://firebase.google.com/docs/crashlytics/test-implementation?platform=ios recommends using "@[][1]" to crash,
// but that gets caught by react-native and shown as a red box for debug builds. Throw a different kind exception
// here to generate a hard crash.
@throw NSInternalInconsistencyException;
// but that gets caught by react-native and shown as a red box for debug builds. Raise SIGSEGV here to generate a hard crash.
int *p = 0;
*p = 0;
}
}

Expand Down

1 comment on commit 2dcaad5

@vercel
Copy link

@vercel vercel bot commented on 2dcaad5 Oct 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.