Skip to content

Commit

Permalink
fix(crashlytics, debug): Disable Crashlytics in debug mode by default (
Browse files Browse the repository at this point in the history
…#5117)

* Update ReactNativeFirebaseCrashlyticsInitProvider.java

Disabled crashlytics in debug mode by default.

* Update RNFBCrashlyticsInitProvider.m

Disabled crashlytics in debug mode by default on iOS.

* only alter crashlytics status to disable it, if it was not enabled
before in the auto collection settings it should not be enabled now

this matches the android implementation

Co-authored-by: Waqas Ahmed <[email protected]>
  • Loading branch information
mikehardy and waqas19921 authored Apr 4, 2021
1 parent c94546d commit eeeba2e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ static boolean isCrashlyticsCollectionEnabled() {
} else {
enabled = meta.getBooleanValue(KEY_CRASHLYTICS_AUTO_COLLECTION_ENABLED, true);
}

if (!json.getBooleanValue(KEY_CRASHLYTICS_DEBUG_ENABLED, false) && BuildConfig.DEBUG) {
enabled = false;
}

return enabled;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ + (BOOL)isCrashlyticsCollectionEnabled {
enabled = [RNFBMeta getBooleanValue:KEY_CRASHLYTICS_AUTO_COLLECTION_ENABLED defaultValue:YES];
DLog(@"isCrashlyticsCollectionEnabled via RNFBMeta: %d", enabled);
}

#ifdef DEBUG
if (![[RNFBJSON shared] getBooleanValue:KEY_CRASHLYTICS_DEBUG_ENABLED defaultValue:NO]) {
enabled = NO;
}
DLog(@"isCrashlyticsCollectionEnabled after checking RNFBJSON %@: %d", KEY_CRASHLYTICS_DEBUG_ENABLED, enabled);
#endif

DLog(@"isCrashlyticsCollectionEnabled: %d", enabled);

Expand Down

1 comment on commit eeeba2e

@vercel
Copy link

@vercel vercel bot commented on eeeba2e Apr 4, 2021

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.