EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 448 forks source link

Init is not a function iOS #1700

Closed Mflm closed 3 years ago

Mflm commented 3 years ago

Hi,

I have a project with pure JS (Vainilla) and updated to Nativescript 7.

I can't run the lastest version of plugin.

In app.js I have: import { firebase } from '@nativescript/firebase'; And the error is:

firebase.init is not a function.

Thanks

peppeg85 commented 3 years ago

the same here, vanilla javascript, import the new plugin, app installed on the emulator but crashes and have the error firebase.init is not a function

here is my code in app.js:

var firebase =require("@nativescript/firebase")

setTimeout(()=>{
    firebase.init({
          ...some code
    })
},0);
peppeg85 commented 3 years ago

@EddyVerbruggen are there any news?

peppeg85 commented 3 years ago

seems to be solved this way

var firebase = require("@nativescript/firebase").firebase;

please add the info to the documentation!

xlund commented 3 years ago
var firebase = require("@nativescript/firebase").firebase;

This solved it for me. Thanks!

EddyVerbruggen commented 3 years ago

Feel free to send a PR to the docs.