Property 'messaging' does not exist on type 'AngularFireMessaging' 1

Property ‘messaging’ does not exist on type ‘AngularFireMessaging’

constructor(private angularFireMessaging: AngularFireMessaging) {
this.angularFireMessaging.messages.subscribe(
(_messaging: AngularFireMessaging) => {
_messaging.onMessage = _messaging.onMessage.bind(_messaging);
_messaging.onTokenRefresh = _messaging.onTokenRefresh.bind(_messaging);
}

Here is what the above code is Doing:
1. We are importing the AngularFireMessaging service from the angularfire2 library.
2. We are injecting the AngularFireMessaging service into the constructor of the AppComponent class.
3. We are subscribing to the messages observable of the AngularFireMessaging service.
4. We are binding the onMessage and onTokenRefresh methods of the AngularFireMessaging service to the AngularFireMessaging service itself.

Similar Posts