I'm using cordova phonegap-plugin-push and Amazon Web Services SNS to receive push notifications in my ionic 2 app. Here is the plug-in documentation.
When I send a notification I have to configure the payload in the backend, such as:
{
"notification": {
"title": "The notification title",
"body": "Some notification body with relevant data",
"notId": 10
}
}
But I don't want to write a title or a body with the exact words I want to appear in the notification. I would like to write something like this:
{
"notification": {
"event": "someEventID",
"notId": 10
}
}
And then, in the app client, manage that event ID and associate it with some title and body that will be shown in the notification.
Is this possible?
Thank you.
Finally I found the answer. It is necessary to send in the payload the exact text you want to show in the notification, because push notifications are received even when the app is not running, and therefore there is no way for the app to format/parse the text.