swiftdroid
swiftdroid

Reputation: 33

How to cancel Firebase setValue while pending for completion (when offline)

I can call ref.removeAllObservers() for reading data (such as observeEventType) if I want to stop listening for real time changes. However, i cannot find a way to interrupt and cancel the setValue (writing data). There are some use case which I need to cancel the writing of data while waiting for some time for internet connection to get back online. Is it possible and how?

Upvotes: 1

Views: 807

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598728

If there is a write queue, you can empty it by calling FIRDatabase.purgeOutstandingWrites().

Upvotes: 4

Related Questions