I use Firestore (from Firebase) and I have tried, without success, to disable the usage of the cache.
Here is my problem. If I disconnect my device from the internet and that I execute this ...
getFireStoreInstance()
.collection(PATH)
.document(myObject.id)
.set(myObject)
.addOnCompleteListener( ... )
or this ...
getFireStoreInstance()
.collection(PATH)
.batch()
.update(...)
.commit()
... nothing happens (which is good because I don't have any internet connection). However, as soon as I reconnect my device to the internet, the completionListener is called to notify me that the action has been completed.
What I would like is that, when my device does not have access to the internet, the action fails and that the completionListener is called with failure. Is that possible?
Of course, I have tried the following code (from Firestore doc) but it looks to have no effect for writing (it has effect for reading though).
val settings = FirebaseFirestoreSettings.Builder()
.setPersistenceEnabled(false)
.build()
FirebaseFirestore.getInstance().firestoreSettings = settings
Thank you in advance