Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const configure = () => {
if (__DEV__) {
firebase.config().enableDeveloperMode();
}
// Set default values
firebase.config().setDefaults({
survey_url: '',
});
// firebase.fabric.crashlytics().crash();
};
let app = firebase.app();
app.analytics().setAnalyticsCollectionEnabled(true);
export default firebase;
function* initializeFirebase() {
const address = yield call(getAccount)
if (!FIREBASE_ENABLED) {
Logger.info(TAG, 'Firebase disabled')
yield put(showError(ErrorMessages.FIREBASE_DISABLED))
return
}
Logger.info(TAG, 'Firebase enabled')
try {
const app = firebase.app()
Logger.info(
TAG,
`Initializing Firebase for app ${app.name}, appId ${app.options.appId}, db url ${
app.options.databaseURL
}`
)
yield call(initializeAuth, firebase, address)
yield put(firebaseAuthorized())
yield call(initializeCloudMessaging, firebase, address)
Logger.info(TAG, `Firebase initialized`)
return
} catch (error) {
Logger.error(TAG, 'Error while initializing firebase', error)
yield put(showError(ErrorMessages.FIREBASE_FAILED))
}