firebase - Adding Ionic notificacions when a new chat msg arrives -


i have chat app made ionic , firebase, similar whatsapp or facebook messenger.

i looking way send notification everytime sends new message. far i’ve seen ionic.io following tutorial in spanish https://www.ion-book.com/blog/ionic2/ionic-push-notifications/

in tutorial, says in order notification need put code in app.components.ts

private getnotifications(){   this.push.rx.notification()   .subscribe((msg) => {     alert(msg.title + ': ' + msg.text);   }); } 

and send notification using ionic.io dashboard. cool, let's want send notification every time receives new message: there way put code in list view of chats or maybe in firebase function every time new node chat added db sends notification?

thanks!


Comments