How to use the react-native-firebase.app function in react-native-firebase

To help you get started, we’ve selected a few react-native-firebase examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github squatsandsciencelabs / OpenBarbellApp / app / services / Firebase.js View on Github external
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;
github celo-org / celo-monorepo / packages / mobile / src / firebase / saga.ts View on Github external
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))
  }