ionic firebase - TypeError: Object(…) is not a function at Firebase.getToken

前端 未结 1 1958
谎友^
谎友^ 2021-01-14 17:32

I am following a little tutorial to install and use firebase,

But I can\'t even pass the part where I have to do

this.firebase.getToken().then(token

相关标签:
1条回答
  • 2021-01-14 18:37

    I have answered a similar question here https://stackoverflow.com/a/54398403/6617276

    Check your project type in ionic.config.json file.

    If the type is "ionic-angular", then install 4.x.x version.

    npm i -s @ionic-native/firebase@4.20.0
    

    If the type is "angular", then install 5.x.x-beta version

    npm i -s @ionic-native/firebase@5.0.0-beta.24
    

    Note:

    Add ngx at the end of import only if you are using Angular 6

    import { Firebase } from '@ionic-native/firebase/ngx';
    

    if not remove ngx from the import both in app.module.ts and app.component.ts

    import { Firebase } from '@ionic-native/firebase';
    

    Refencence:https://github.com/ionic-team/ionic/issues/15225#issuecomment-414074074

    0 讨论(0)
提交回复
热议问题