Tauseef Mamun
Tauseef Mamun

Reputation: 124

NullInjectorError: No provider for Firebase! for Ionic Framework

I was following https://ionicframework.com/docs/native/fcm/ to integrate Firebase into my Ionic project. It was showing runtime error, not finding a Firebase provider.

Runtime error:

enter image description here

Upvotes: 3

Views: 6935

Answers (1)

Mahesh Jadhav
Mahesh Jadhav

Reputation: 1089

This might be because you forgot to add it in your app module providers list.

Import it in your app.module.ts and add it to the providers list it should then work

import {FCM} from '@ionic-native/fcm'

@NgModule({
  ... 
  providers : [
    ... 
    FCM
  ]
}) 

Upvotes: 8

Related Questions