Hi guys!
I am implementing push notification for the chat in my app.
It is working fine. I am properly receive the notification - sent with a cURL request when a new message is sent.
The thing is:
Back in the days with Ionic 1 - I was receiving the notification only when the app was off or in background.
Now i receive the notification also when the app is on - when I don’t need it.
How can fix this?
The cURL request in the API is exactly the same (just updated the profile and token)
For the code in the app I am following the documentation.
This how I register the user after the login:
this.push.register().then((t: PushToken) =>
{
return this.push.saveToken(t);
}).then((t: PushToken) =>
{
// save t.token in database
});
And for the subscribe to the notification I have nothing yet:
this.push.rx.notification()
.subscribe((msg) => {
// alert(msg.title + ': ' + msg.text);
});
Any suggestion?
Thank you very much!