I am using phonegap-plugin-push
with Ionic3
.
In the plugin-push documentation
they are saying that on Android device we should use only data
payload and not the notification
in order the on('notification')
will be triggered.
So far so good, but sending only the data payload, causing the notification tray to replace/overrides existing notification previously sent.
When sending notification
payload, a new notification enters the notification tray without replacing existing one, but on tap event not triggered.
How can I achive both behaviors?
My payload:
{
"message":{
"android":
{
"data":{
"title":"Hello",
"body":"Hello",
"timestamp":"2018-12-20T09:56:55.3250752+02:00"
}
},
"apns":{
"payload":{
"aps":{
"alert":{
"title":"Hello",
"body":"Hello",
"timestamp":"2018-12-20T09:56:55.3250752+02:00"
}
}
}
},
"token": "f9j....."
}
}