public FirestoreService() { cards = new List <Card>(); Firestore dbRef = Firestore.Create(Firebase.Core.App.DefaultInstance); dbRef.GetCollection("cards").GetDocuments((snap, err) => { if (err != null) { Debug.WriteLine(err); } else { DocumentSnapshot[] docs = snap.Documents; foreach (DocumentSnapshot doc in docs) { if (doc.Exists) { var data = (CardObj)doc.Data; if (data != null) { cards.Add(data); } else { Card errorCard = new Card { Text = doc.Id, Subtext = doc.Reference.ToString(), Type = "error" }; cards.Add(errorCard); } } } } }); }
public static void GetCalibrationData(string deviceModel, DocumentSnapshotHandler completion) { var docRef = db.GetCollection(Collections.CalibrationData).GetDocument(deviceModel); docRef.GetDocument(completion); }