You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added some data in firestore,but I can not get these data when carry out code.
My code :
let db = Firestore.firestore()
db.collection("in_app_messages").getDocuments() { (querySnapshot, err) in
if let err = err {
print("Error getting documents: (err)")
} else {
for document in querySnapshot!.documents {
print("(document.documentID) => (document.data())")
// inAppMessage.id = document.documentID
}
}
}
I am sure in firestore database the data exist. But the result show err is nil and querySnapshot!.documents'count is zero.
I can not figure out why there is no document in collection "in_app_messages".
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I added some data in firestore,but I can not get these data when carry out code.
My code :
let db = Firestore.firestore()
db.collection("in_app_messages").getDocuments() { (querySnapshot, err) in
if let err = err {
print("Error getting documents: (err)")
} else {
for document in querySnapshot!.documents {
print("(document.documentID) => (document.data())")
// inAppMessage.id = document.documentID
}
}
}
I am sure in firestore database the data exist. But the result show err is nil and querySnapshot!.documents'count is zero.
I can not figure out why there is no document in collection "in_app_messages".
GoogleService-Info.plist was Already configured.
Does anyone know what's going on?
Beta Was this translation helpful? Give feedback.
All reactions