SwaX
SwaX

Reputation: 97

Connecting Firebase with NativeScript

So i installed firebase with adding the "google-services.json" in the App_Resources/Android folder.

enter image description here

After that i used the cli for the cmd: "tns plugin add @nativescript/firebase". And it was successfull.

enter image description here

But if i try to use "firebase.firestore()" i get the message that firestore is unknown.

enter image description here

Yes i have ticked yes in the installation as it asked me if i want firestore.

enter image description here

So it should be useful but it is not. I deleted the "firebase.nativescript.json" and run the 'npm run config' command in the android folder but it didnt help. Then I uninstalled the plugin with "tns plugin remove @nativescript/firebase" and re-installed it. Nothing works. Here is my fire in @nativescript:

enter image description here

Is there a Solution?

Upvotes: 0

Views: 305

Answers (1)

William Juan
William Juan

Reputation: 1415

You should be able to import firestore directly from @nativescript/firebase and access its properties that way

import { firestore } from '@nativescript/firebase';

// firebase.firestore().collection('user') becomes the following line
firestore.collection('user')

Upvotes: 1

Related Questions