Closed ronycohen closed 8 years ago
Hey @ronyrun, I am afraid this is more of an Ionic/cordova-related question. I would recommend you ask it on StackOverflow :smile:
I/we don't have much experience with cordova og ionic, I'm afraid :frowning:
Hello @hypesystem thank you for your answer !
Can you confirm to me that the contentAvailable: true,
will create a "content-available": "1" in the datas sent ?
Currently that's probably my issue because when the app is closed or in background, I get the notification but when the user click on the notification my event handler is not working.
var messageTest = new gcm.Message({
priority: 'high',
contentAvailable: true,
delayWhileIdle: true,
timeToLive: 3,
data: {
key1: 'message1',
key2: 'message2'
},
notification: {
title: "Hello, World",
icon: "icon",
body: "This is a notification that will be displayed ASAP.",
},
});
I solve the issue !
the notification property has to be deleted and everything needs to go into the data property.
Great! I'm glad you found a solution!
The notification
field is for information that is shown on the device as soon as the notification is received. We have heard of similar issues with phonegap/cordova/ionic before: the notification
field doesn't seem widely supported in those libraries.
you should add that to your readme :)
We actually have a section about it: https://github.com/ToothlessGear/node-gcm/#gcm-client-compatibility :smile:
I'm so sorry ! Thank you very much !
Hello, currently I'm using node-gcm (amazing thank you!) and I'm properly getting notifications with phonegap-plugin-push.
When the app is closed, a click on the notification open the Ionic / cordova app wthout problems.
I would like to do more and redirect the user to a defined Route $state inside the application.
Do you know how to do that ?
Regards,