-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Background notification OK, but event "notification" never called #387
Comments
@cmillauriaux trying sending this instead and let me know what you find. I recently discovered that Google will just eat messages sent using the "notification" property and not pass them on to the push handler. var message = new gcm.Message({
collapseKey: "applice",
delayWhileIdle: true,
timeToLive: 3,
data: {
title: "Hello, World",
icon: "icon",
message: "This is a notification that will be displayed ASAP."
}
}); |
@macdonst you're my hero ! Thanks a lot ! I searched desperatly on the plugin side, but it was on the server side. You saved my day ! |
@cmillauriaux sorry about that, I need to document it better cc: @fredgalvao |
@macdonst Funny thing, neither of these are technically wrong. Check node-gcm's usage doc and the official docs on gcm, and you'll see that
Now, if what you said is that for some reason we cannot trust in the |
Oh, I guess I understand now. There is a distinction between Notification payload
Data payload
So, I'm assuming that we want to handle everything by ourselves, which leaves us requiring the
I'll update the docs with a topic on this soon. |
@fredgalvao Yup, I found that out while writing a service to send messages using node-gcm. It really tripped me up for awhile. Yes, we will need to be more opinionated and have people use the |
@fredgalvao Yeah, there is an issue with data/notification in that Android and iOS don't treat them the same. I opened #401 to do some testing in the 1.5.x branch. They really should work the same. |
FYI: https://github.com/ToothlessGear/node-gcm#gcm-client-compatibility lists this as an open bug (Jan 2016). Is it still open? |
@MichaelJCole send everything in the |
Hey, anyone experiencing my case ?
Tried a combinaison of all of them, no luck too. |
This thread has been automatically locked. |
Hi everyone,
I installed the plugins and configure android notifications, but, when i send a notification from my server (node-gcm), the notification is shown in the navbar like the application is in the background. If i click in this notification, nothing happened. The most important is if i add a console.log instruction in the "notification" event, nothins is print in the console. So, i think my notification message is never catch by the plugin. Any idea ?
Server message :
Client side :
The text was updated successfully, but these errors were encountered: