-
Notifications
You must be signed in to change notification settings - Fork 1.9k
1.4.x not showing notification on Android #299
Comments
so after changing {
"image": "urltopicture.jpg",
"message": "test",
"additionalData": {
"summaryText": "There are %n% new notifications",
"gcm.notification.notId": "121",
"gcm.notification.title": "Title 1",
"id": "121",
"tag": "121",
"style": "inbox",
"coldstart": false,
"collapse_key": "org.company.app",
"foreground": false
}
} The |
Shouldn't this break for more people? :O |
@AdriVanHoudt can you send me an example of data you are sending to GCM. That will really help me debugging this. |
Also @AdriVanHoudt do you see different results if the app is closed vs forground vs background @macdonst I suspect this is caused by the GcmListenerService code. I think that it displays the notification if there is a gcm.notification.title or gcm.notification.body key in the message. I wonder if it is bypassing our normlize in those cases? |
@smdvdsn I see nothing, only difference is that when in foreground it immediately handles the message and otherwise it waits for the app to open this is (roughly, I use a lib which accepts the registration ids as a different param) what I send to gcm: {
data: undefined,
notification: {
title: 'Title 1',
body: 'test',
image: 'http: //urltopicture.jpg',
id: 121,
tag: 121,
style: 'inbox',
summaryText: 'Thereare%n%newnotifications',
notId: 121
}
} |
@AdriVanHoudt thanks, I can reproduce it now using node-gcm to send a push with your test data. Stay tuned. |
Cool, I will, also debugging this myself (at least trying :D) |
@AdriVanHoudt it's something weird when we iterate through the key set of the extras coming in from GCM. For some reason we skip a few. |
jup managed to get this out of debugger: D/PushPlugin_GCMIntentService(26109): onMessage - from: 128469695999
D/PushPlugin_GCMIntentService(26109): mormalize extras
D/PushPlugin_GCMIntentService(26109): key = gcm.notification.image
D/PushPlugin_GCMIntentService(26109): replace key gcm.notification.image with image
D/PushPlugin_GCMIntentService(26109): key = gcm.notification.style
D/PushPlugin_GCMIntentService(26109): replace key gcm.notification.style with style
D/PushPlugin_GCMIntentService(26109): key = gcm.notification.summaryText
D/PushPlugin_GCMIntentService(26109): replace key gcm.notification.summaryText with summaryText
D/PushPlugin_GCMIntentService(26109): key = image
D/PushPlugin_GCMIntentService(26109): key = style
D/PushPlugin_GCMIntentService(26109): key = gcm.notification.body
D/PushPlugin_GCMIntentService(26109): replace key gcm.notification.body with body
D/PushPlugin_GCMIntentService(26109): key = gcm.notification.tag
D/PushPlugin_GCMIntentService(26109): replace key gcm.notification.tag with tag
D/PushPlugin_GCMIntentService(26109): key = gcm.notification.id
D/PushPlugin_GCMIntentService(26109): replace key gcm.notification.id with id
D/PushPlugin_GCMIntentService(26109): key = collapse_key |
@AdriVanHoudt @smdvdsn I'm pretty sure it is a concurrent modification problem. When the |
@AdriVanHoudt @smdvdsn Yup, that was it. Can you test branch |
on it |
it is working now, big thank you @macdonst for fixing this so quickly, you doing a patch release now? |
Yes, I will do a patch and release to NPM in the next 10 minutes. It didn't surface in my testing as I wasn't mixing data and notification. |
@AdriVanHoudt published version 1.4.2 |
* 'master' of github.com:phonegap/phonegap-plugin-push: Version 1.4.2 Issue phonegap#299: 1.4.x not showing notification on Android Version 1.4.1 Issue phonegap#295: data.registrationId is empty string "" on register event callback Issue phonegap#291: Reregister on Android [typo] fixing .finish() example Update CHANGELOG Version 1.4.0 Issue phonegap#93: Receive Notifications in Background
This should be in the readme or in a visible place... I've spent several hours until I found this fix... |
How so? This fix is to make it working like it should/like in the readme |
I mean, just adding a little section with notices for regressions and breaking changes in the readme (the first thing one reads when arrives to the repo) so newcomers don't spend 5 hours banging their heads against the wall before realising they have to install the plugin via git clone. |
This fix was published as 1.4.1 so need to git clone, are you allowing pathes in your config.xml? I have it set at 1.4.x. It is possible you need to reinstall the plugin to get the right version |
I've been using this plugin only since yesterday. First I installed the plugin via
and I wasn't receiving the notifications, then after finding this issue I finally installed with
and started working. I was just just suggesting to include a section with references to major breaking changes (like this one) in the readme of the repo, maybe pointing out to the corresponding issues... |
hmm weird I have |
@telemakhos Yeah, I don't think we need to add it to the README as it is already fixed. Whenever I do a minor release I do a blog post with all the changes/fixes. It's really odd that |
This thread has been automatically locked. |
Sending the exact same payload. 1.3 works fine, 1.4 just call the
.on('notification, fn)
with all keys inadditionalData
The text was updated successfully, but these errors were encountered: