Firestore pricing when listener is stopped and started

Viewed 72

Say I start a listener in viewWillAppear(:animated). The result is that I download 10 documents from Firestore. When the user navigates away from that viewController i remove the listener in viewWillDisappar(:animated).

The user then navigates back (say one minute later) to the same viewController. The listener starts and I get the 10 documents again. Now the question is - Will I be charged for reading 20 documents? Or will I be charged for 10 given this:

Listening to query results

Cloud Firestore allows you to listen to the results of a query and get realtime updates when the query results change.

When you listen to the results of a query, you are charged for a read each time a document in the result set is added or updated. You are also charged for a read when a document is removed from the result set because the document has changed. (In contrast, when a document is deleted, you are not charged for a read.)

Also, if the listener is disconnected for more than 30 minutes (for example, if the user goes offline), you will be charged for reads as if you had issued a brand-new query.

That last paragraph is the one confusing me. If a actively stop the listener and start it again, is that covered by the 30 minutes? Or is is a new read?

0 Answers
Related