Cloud Firestore: retrieving cached data via direct get?

前端 未结 3 1561
借酒劲吻你
借酒劲吻你 2020-12-16 21:44

Retrieving data from the server may take some seconds. Is there any way to retrieve cached data in the meantime, using a direct get?

The onComplete seem

3条回答
  •  眼角桃花
    2020-12-16 22:03

    You can disable network access and run the query to access data from cache . For firestore : https://firebase.google.com/docs/firestore/manage-data/enable-offline#disable_and_enable_network_access For firebase database call db.goOffline() and db.goOnline()

提交回复
热议问题