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?
GoogleService-Info.plist
? – creeperspeak