I'm creating a swift 4 ios application and would like to use Firestore to store all my data. I've gone through the getting started guides and watched the online tutorial, but I continue to get the error:
"4.8.1 - [Firebase/Firestore][I-FST000001] Could not reach Firestore backend."
my cocoapods file contains:
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
In AppDelegate
: I import Firebase
and in didFinishLaunchingWithOptions
I do FirebaseApp.configure()
In viewController: import Firebase
(have also tried import FirebaseFirestore
)
I define:
var docRef : DocumentReference!
and in viewDidLoad:
docRef = Firestore.firestore().document("test/test")
docRef.getDocument { (docSnapshot, error) in
guard let docSnapshot = docSnapshot, docSnapshot.exists else {return}
let myData = docSnapshot.data()
let val = myData!["name"] as? integer_t ?? 1
print(val)
}
and I get the error
"4.8.1 - [Firebase/Firestore][I-FST000001] Could not reach Firestore backend."
I have my firestore set to test mode so all reads and writes should be allowed. Anyone of ideas as to why I can't connect to the backend?
Cloud Firestore ships with mobile and web SDKs and a comprehensive set of security rules so you can access your database without needing to stand up your own server. Using Cloud Functions , our serverless compute product, you can execute hosted backend code that responds to data changes in your database.
In my case, I was trying to add data into "Real-Time Database
" of Firebase Console and then read in my new AngularFire2
app.
Realized after a while that it has to be "Cloud Firestore".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With