Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Nativescript support #192

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
ibonkonesa opened this issue Jun 3, 2018 · 14 comments
Closed

Nativescript support #192

ibonkonesa opened this issue Jun 3, 2018 · 14 comments
Labels
contribution welcome If nobody has proposed a PR for this feature yet, feel free to comment and work on it docs question

Comments

@ibonkonesa
Copy link

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

@posva
Copy link
Member

posva commented Nov 19, 2018

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 🙁

@posva posva added contribution welcome If nobody has proposed a PR for this feature yet, feel free to comment and work on it question labels Nov 19, 2018
@jlooper
Copy link

jlooper commented Mar 3, 2019

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.

@posva
Copy link
Member

posva commented Mar 11, 2019

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

@jlooper
Copy link

jlooper commented Mar 11, 2019

@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

@posva
Copy link
Member

posva commented Mar 11, 2019

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!

@jlooper
Copy link

jlooper commented Mar 11, 2019

@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...

@EddyVerbruggen
Copy link

EddyVerbruggen commented Mar 14, 2019

@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);

@posva
Copy link
Member

posva commented Mar 14, 2019 via email

@EddyVerbruggen
Copy link

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..

@posva
Copy link
Member

posva commented Mar 14, 2019 via email

@EddyVerbruggen
Copy link

@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

@tralves
Copy link

tralves commented Jun 18, 2019

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!

@posva
Copy link
Member

posva commented Jun 18, 2019

since that should work with the Firebase JS SDK, it may be worth updating the docs

@posva posva added the docs label Jun 18, 2019
@tralves
Copy link

tralves commented Jun 19, 2019

Yes. There is a small difference that nativescript-plugin-firebase's init method does not return a firebase instance.

@vuejs vuejs locked and limited conversation to collaborators Nov 18, 2022
@posva posva converted this issue into discussion #1254 Nov 18, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
contribution welcome If nobody has proposed a PR for this feature yet, feel free to comment and work on it docs question
Projects
None yet
Development

No branches or pull requests

5 participants