We're trying to get data from a push when the application is killed.
Here a stack info:
Android: 8
device: Xiaomi Redmi 5
cordova: 7.1.0
cordova-android: 6.4.0
phonegap-plugin-push: 2.1.2
Registration and Handlers Set
user registers FCM token and exec. the following code. Finally
push.on('notification', (data) => {
.... statement_1
callbackA(data);
})
push.subscribe('notification', (data) => {
.... statement_2
// This statement is called only if
// app is closed and the user taps
// onto notification in the shade
})
We are registering and subscribing to on the same 'notification' event due to a problem with Android / App Closed. ( Normally, 'notification' event is not triggered if user tap on the notification when the app is killed -- see https://github.com/phonegap/phonegap-plugin-push/issues/2859 )
server push request example
{
"registration_ids" : [ "...." ],
"priority" : 5,
"data" : {
"title" : "Push with URL",
"message" : "Questo invece รจ un esempio di push con un URL ",
"purpose" : "NEWS",
"id" : "2",
"notId" : 5,
"url" : "https://www.ciao.it/",
"actions":[
{
"title":"Accept",
"callback":"show",
"foreground":true
}
]
}
}
Problem is that now, the event is triggered correctly, but plugin pass ad data 'OK' string instead push data for both statements (1-2).
What's wrong??
( FYI : Normal scenarios [background, foreground] are working like a charm! )
Super thanks in advance