Skip to content

Commit

Permalink
move into platform setup files
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaaron committed Nov 9, 2022
1 parent 9ce8b48 commit 9f5e58a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {LogBox} from 'react-native';
import {GestureHandlerRootView} from 'react-native-gesture-handler';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import Onyx from 'react-native-onyx';
import crashlytics from '@react-native-firebase/crashlytics';
import CustomStatusBar from './components/CustomStatusBar';
import ErrorBoundary from './components/ErrorBoundary';
import Expensify from './Expensify';
Expand All @@ -15,14 +14,6 @@ import ComposeProviders from './components/ComposeProviders';
import SafeArea from './components/SafeArea';
import * as Environment from './libs/Environment/Environment';
import {WindowDimensionsProvider} from './components/withWindowDimensions';
import CONFIG from './CONFIG';

// We do not want to send crash reports if we are on a locally built release version of the app.
// Crashlytics is disabled by default for debug builds, but not local release builds so we are using
// an environment variable to enable them in the staging & production apps and opt-out everywhere else.
if (!CONFIG.SEND_CRASH_REPORTS) {
crashlytics().then(config => config.setCrashlyticsCollectionEnabled(false));
}

// For easier debugging and development, when we are in web we expose Onyx to the window, so you can more easily set data into Onyx
if (window && Environment.isDevelopment()) {
Expand Down
9 changes: 9 additions & 0 deletions src/setup/platformSetup/index.native.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import crashlytics from '@react-native-firebase/crashlytics';
import CONFIG from '../../CONFIG';
import PushNotification from '../../libs/Notification/PushNotification';
import * as Report from '../../libs/actions/Report';
import Performance from '../../libs/Performance';
Expand All @@ -13,6 +15,13 @@ import '@formatjs/intl-numberformat/locale-data/en';
import '@formatjs/intl-numberformat/locale-data/es';

export default function () {
// We do not want to send crash reports if we are on a locally built release version of the app.
// Crashlytics is disabled by default for debug builds, but not local release builds so we are using
// an environment variable to enable them in the staging & production apps and opt-out everywhere else.
if (!CONFIG.SEND_CRASH_REPORTS) {
crashlytics().setCrashlyticsCollectionEnabled(false);
}

/*
* Register callbacks for push notifications.
* When the app is completely closed, this code will be executed by a headless JS process thanks to magic in the UrbanAirship RN library.
Expand Down

0 comments on commit 9f5e58a

Please sign in to comment.