I'm trying to implement firestore in my project. What I'm doing right now is just implementing it and read some data, but I get the error in the title :
XMLHttpRequest cannot load https://firestore.googleapis.com/google.firestore..... due to access control checks.
I use the following :
// Initialize Firebase
var config = {
apiKey: "xxx",
authDomain: "xxx",
databaseURL: "xxx",
projectId: "xxx",
storageBucket: "xxx",
messagingSenderId: "xxx"
};
firebase.initializeApp(config);
// Initialize Cloud Firestore through Firebase
var db = firebase.firestore();
var docRef = db.collection("users");
docRef.get().then(function(querySnapshot) {
querySnapshot.forEach(function(doc) {
//alert(doc.data().born);
});
})
.catch(function(error) {
console.log("Error getting documents: ", error);
});
The part where I try to retrieve the data cause the error (docRef.get()...)
Do you have an idea why is this error happening ?
Thanks in advance,
