As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
The Phonegap push plugin, com.phonegap.plugins.PushPlugin is not receiving the message payload it expects. On iOS it's fine, but on Android, the message to the notification system (when the app is in the background) is "" . Might very well be a problem with the plug-in itself, but just wanted to check with you to see how you are broadcasting the payload.
The plug-in is expecting the message to come in via "message" node, according to the docs.
I just saw that this was under Android so I'm updating to JavaScript since it's the PhoneGap SDK-- that will help get eyes on it faster!
M
Mark
said
over 9 years ago
I am able to successfully receive a push notification in Android using the broadcast function. How are you sending your push notifications?
The plugin reads the "msg" property, since that is what is set when you send push notifications through Kinvey (either using collection hooks or custom endpoints).
On iOS with the app in the background, the notification appears properly in iOS Notification Centre.
On Android, with the app in the background, the notification appears but the body of it says .
When the app is in the foreground,
iOS also works fine but Android receives an object instead of a string [object Object] for payload.msg.
Interestingly, if use modules.push.send instead of sendPayload, iOS is fine, Android background has the same error but Android foreground works correctly and payload.msg is a string, not an object.
I don't expect you to debug on the client side, but there seems to be some inconsistency on send and sendPayload. Can you document a snapshot of both? I can then compare it against the push plug-in for phonegap and see what's going wrong.
M
Mark
said
over 9 years ago
I’m not sure what is going on. In the Android Emulator, using `modules.push.send()` works fine - the app alerts the push message both in back- and foreground.
When using `modules.push.sendPayload()`, the app alerts the push payload (which will alert `[object Object]`). Meaning that, in your app, the `data.message` contains the payload (which is an object) sent.
Are you trying this out on the emulator or real device? Either way, when you get the "missing message content", is there something logged in LogCat?
D
Daniel Roizman
said
over 9 years ago
Hey Mark,
Here's the difference in payload received:
With modules.push.send:
V/PushPlugin(16069): extrasToJSON: {"payload":{"msg":"Daniel Roizman commented on your post: Several variants on packaging, choose wisely"},"collapse_key":"do_not_collapse","from":"1063735744857","foreground":true,"event":"message"}
and with modules.push.sendPayload:
V/PushPlugin(16069): extrasToJSON: {"payload":{"msg":{"message":"Daniel Roizman has just commented on your post: So good. Not too sweet."}},"collapse_key":"do_not_collapse","from":"1063735744857","foreground":true,"event":"message"}
with sendPayload, the extra payload is stuffed into a dictionary in payload.msg so my client side javascript needs to access payload.msg.message .
Is that expected for the two to send commands to send differently? If so, I can account for that on my end.
M
Mark
said
over 9 years ago
Yes, that is the expected format.
R
Randolph
said
over 9 years ago
Are you also experiencing an issue with how the notification comes up in the Android notification tray? For me the notification displays the entire object (e.g., "{message: txt, msg: txt, from: "Hiyu", subject:txt }"
I can figure out how to have the client-side javascript get the object properties, but I can't figure out how to get the plug-in to pull out the right properties from the object when displaying in the notification tray in Android.
Am i missing something?
D
Daniel Roizman
said
over 9 years ago
Hey Randolph,
Which plug-in are you using? My problem is primarily the notification tray. For me it comes up as . Now that I know that send and sendPayload format the message differently, the in-App side is fine because I can code for it. So now I need to start looking into the java side of things and figure out how it expects the formatting and modify it.
R
Randolph
said
over 9 years ago
My issue is also on the push notification tray side, where I cannot get it to pull a specific part of the payload instead of showing the entire contents.
I'm using the plugin install: phonegap local plugin add "https://github.com/Kinvey/phonegap-push-plugin"
In the GCMIntentService handler createNotification, I've tried messing around with some of the code there, but cannot get it to pull specific parts of the message.
Daniel Roizman
The plug-in is expecting the message to come in via "message" node, according to the docs.