Skip to content

React Native: Error: @firebase/firestore: ", "Firestore(4.10.1): Could not reach Firestore backend " #638

Closed
@Luckygirlllll

Description

@Luckygirlllll

[REQUIRED] Describe your environment

Operating System version: IOS (React Native), Android (React Native)
Firebase SDK version: 4.12.0
Firebase Product: Firestore

Error: @firebase/firestore: ", "Firestore(4.10.1): Could not reach Firestore backend "

Steps to reproduce:

Add npm install [email protected] --save to the react native project
Add the code below to the project
Nothing is happening (collections and documents were not created)

Relevant Code:

import * as firebase from 'firebase'
import firestore from 'firebase/firestore'

var config = {
  apiKey: "xxxxxxxxxxxxxxxxxx",
  authDomain: "xxxxxxxxxxxxxxxxxx",
  databaseURL: "xxxxxxxxxxxxxxxxxx",
  projectId: "xxxxxxxxxxxxxxxxxx",
  storageBucket: "xxxxxxxxxxxxxxxxxx",
  messagingSenderId: "xxxxxxxxxxxxxxxxxx"
};

firebase.initializeApp(config);

var db = firebase.firestore();

var docRef = db.collection('users').doc('alovelace');

var setAda = docRef.set({
    first: 'Ada',
    last: 'Lovelace',
    born: 1815
})

db.collection("users").get().then((querySnapshot) => {
      querySnapshot.forEach((doc) => {
          console.log(`${doc.id} => ${doc.data()}`)
      })
    })

screen shot 2018-04-05 at 15 50 21

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions