Skip to content

Unable to add or retrieve documents via Firestore (React Native) #619

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

Unable to add or retrieve documents via Firestore, there is no errors, no exception, but nothing is happened

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
})

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