Skip to content

VueFire in offline mode #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
carromeu opened this issue Jan 22, 2018 · 6 comments
Closed

VueFire in offline mode #154

carromeu opened this issue Jan 22, 2018 · 6 comments
Labels

Comments

@carromeu
Copy link

Please, sorry dumb question, but VueFire works natively in offline mode? Or I need do any setting? Data sync when online will appear after I lost connection?

I am using VueFire with Vuetify PWA template. All others features of PWA works fine. I access my PWA online and see the list of items from my Firebase collection. So, I close all apps and put device in airplane mode. Starting PWA again all app structure appears fine, but the items from Firebase collection is not loaded. My service worker (and sw-precache) its ok (apparentely).

My PWA (in dev) is located here: htts://e-cow.carromeu.com

Any help?

@posva
Copy link
Member

posva commented Jan 22, 2018

Apparently, offline support in PWA is not supported for firebase: firebase/firebase-js-sdk#17

Closing because there's nothing I can do on VueFire end 😄

@posva posva closed this as completed Jan 22, 2018
@posva posva added the question label Jan 22, 2018
@jc275
Copy link

jc275 commented Mar 7, 2018

This could be re-opened for the firestore branch, as Firestore does support offline persistence.

There are a few caveats:

For the web, offline persistence is an experimental feature that is supported only by the Chrome, Safari, and Firefox web browsers. Also, if a user opens multiple browser tabs that point to the same Cloud Firestore database, and offline persistence is enabled, Cloud Firestore will work correctly only in the first tab.

I'm guessing that the lack of cross-browser support is something to do with IndexedDB features that are missing in Edge browser, but that's only my guess.

However, there seems to be work underway on bringing multi-tab support for firestore offline persistence.

@posva
Copy link
Member

posva commented Mar 7, 2018 via email

@BashCloud
Copy link

BashCloud commented Apr 29, 2018

Yes, Online support can be enable directly by the firebase sdk.

Simply add: firebase().firestore().enablePersistence(); after initializing firebaseApp (in main.js).
May be closed safely.

@michael-strain
Copy link

Is there any way to re-enable offline functionality in the latest version of vuefire? Specifically with Nuxt 3?

Found this article on the firebase docs, but couldn't find where initializeFirestore is called in order to set localCache.
https://firebase.google.com/docs/firestore/manage-data/enable-offline

Would be great to be able to getDocsFromCache when needed.

@posva
Copy link
Member

posva commented Dec 29, 2023

@michael-strain see this page in documentation. This issue is completely outdated, it's better not to revive them 😄

@vuejs vuejs locked as resolved and limited conversation to collaborators Dec 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants