Nativescript support
I'm not able to get this awesome plugin along Nativescript-vue plugin. There is not error, simply no data is returned (I have copy pasted the same code in a web regular project and is working properly).
No data is returned from firebase and no error is being displayed.
Thank you in advance
I simply don't know enough about Nativescript to understand what is missing and do not have the time to dive into it at the moment 🙁
Just saw this now, about 100 years after the question. You wouldn't use VueFire in a NativeScript app, rather use Eddy's plugin - https://github.com/EddyVerbruggen/nativescript-plugin-firebase - a really excellent plugin.
Didn't know of the plugin! Looking at the docs, it looks like you could use both at the same time as it seems the firestore db exposes the same API https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/master/docs/FIRESTORE.md
@posva - is there a DOM dependency in Vue-Fire? If not, it'd be an interesting thing to try to make work with a mobile app
No, there isn't any, I do use WeakMap in Vuexfire. As long as the api for collections and documents is the same, it should work out of the box!
@eddyverbruggen do you think we could use VueFire with NS? I remember AngularFire was a no-go, but there was DOM dependency there w/ jQuery Lite IIRC...
@jlooper I'm not too familiar with the internal workings of Vue, but perhaps it would work by adding a global Mixin in main.ts. Something like this:
// this import loads the Web-API-compatible version of the plugin's firestore implementation
import { firestore } from "nativescript-plugin-firebase/app";
Vue.mixin({
created: function () {
this.$options.firestore = firestore;
}
});
Vue.use(Vuefire);
I don't think there is anything extra needed. What would that be for? On Thu 14 Mar 2019 at 09:02, Eddy Verbruggen [email protected] wrote:
@jlooper https://github.com/jlooper I'm not too familiar with the internal workings of Vue, but perhaps it would work by adding a global Mixin in main.ts. Something like this:
import { firestore } from "nativescript-plugin-firebase/app";
Vue.mixin({ created: function () { this.$options.firestore = firestore; } });
Vue.use(Vuefire);
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vuejs/vuefire/issues/192#issuecomment-472743479, or mute the thread https://github.com/notifications/unsubscribe-auth/AAoicaHuJE2V3D8CKoOVDlwjuQeWXfrVks5vWgIegaJpZM4UX_9x .
--
Eduardo San Martin Morote
Hey Eduardo, I'm assuming somewhere in the Vuefire codebase it expects a require/import of the firebase package. Or there's some other magic going on to wire up the firestore property.
The NativeScript plugin doesn't depens on the npm firebase package, so I thought there would be a need to tell Vuefire somehow that firestore should resolve to the NativeScript-specific implementation.
Like I said, I'm not that familiar with how Vue works internally so there may be a much simpler way..
Oh vuefire relies on the collections and documents passed to implement the same interfaces as the one exposed by firestore like onsnapshot On Thu 14 Mar 2019 at 14:19, Eddy Verbruggen [email protected] wrote:
Hey Eduardo, I'm assuming somewhere in the Vuefire codebase it expects a require/import of the firebase package. Or there's some other magic going on to wire up the firestore property.
The NativeScript plugin doesn't depens on the npm firebase package, so I thought there would be a need to tell Vuefire somehow that firestore should resolve to the NativeScript-specific implementation.
Like I said, I'm not that familiar with how Vue works internally so there may be a much simpler way..
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vuejs/vuefire/issues/192#issuecomment-472850142, or mute the thread https://github.com/notifications/unsubscribe-auth/AAoicXzDheKoTSxzKbxmAtOe_DXWz4hxks5vWkxwgaJpZM4UX_9x .
--
Eduardo San Martin Morote
@posva OK, @jlooper Give it a shot, I think you'll need to follow these steps: https://github.com/vuejs/vuefire/tree/master/packages/vuefire#installation
Hi! I just found this issue and I want to say that vuexfire TOTALLY WORKS with nativescript-plugin-firebase.
@ibonkonesa if you want, I can show some code, but I basically followed the docs. The only difference is in this section of the docs where I did:
firebase.initializeApp();
export const db = firebase.firestore();
instead of
export const db = firebase
.initializeApp({ projectId: 'MY PROJECT ID' })
.firestore()
I shed a tear of joy when I saw it with my own eyes. @posva and @eddyerburgh, you guys rock!
since that should work with the Firebase JS SDK, it may be worth updating the docs
Yes. There is a small difference that nativescript-plugin-firebase's init method does not return a firebase instance.