Not getting the callback on adding document in the collection during offline. Its working good in online mode.
However, the document is getting added, and the listeners listening to the collection is getting the added document snapshot.
let database = Firestore.firestore()
let data = prepareRawDataFromObject(model)
if let data = data {
printLog(" Collection: \(collection)")
printLog(" Data Request: \(String(describing: data)) ")
var documentRef: DocumentReference? = nil
documentRef = database.collection("collection").addDocument(data: data) { (error) in
if let error = error {
failure()
printLog(" Adding Document \(collection): \(error.localizedDescription) ")
} else {
printLog("✅ Document Added successfully...✅")
success(documentRef!.documentID)
}
}
}