Start a new topic

Error sending push for android


i have noticed some strange behavier using the pushmodule inside the business logic.

When i'm sending the androidPlayload, the businesslogic automatically wraps it inside an new json object called "msg".

This is a real problem for me on the clientside (Titanium). Other services like parse just send the raw-data like expected.

Is there any fix/workaround for this? :/ (Or maybe a hint, why kinvey is doing so)

Best, Nico

Hey there Nico, I'm going to do some research about this for you tomorrow morning and will get back to you when I have a decent answer. I just wanted to let you know that this is on my radar.


I have consulted with a few of our engineers on this issue and need to know a bit more information before I'm able to give you a definitive answer one way or another.

Our leading assumptions are that you're getting back a string with what you want inside the message object, which I suppose brings up the question why not extract the data you need using a json parser?

Here's an example of how we recommend doing pushes via titanium (on our dev center):

Please let me know if this helps you solve your issue. Thanks,
var message = attendeesString;//utils.renderTemplate(chattemplate, values);

var iOSAps = { alert: message };

var iOSExtras = {type : "eventreminder", eventID : ""};

var androidPayload = {test : "test"};

push.sendPayload(doc, iOSAps, iOSExtras, androidPayload);

//"currentSendCount: " + (currentSendCount));

//"userCount: " + (userCount));

if(currentSendCount == userCount ){

//console.log("All finish");


}else {


Hey thanks for your reply - maybe i have to be more specific:

Above is my script to send the push - SENDING it, isn't a problem and works like a charme.

I am using a module on Titanium(client) which are handling both ios/android pushes.


This module excepts the rawdata from the push, but kinvey creates this wrapping object "msg" so the module can't handle the android data correctly. (It is only on android)

So for me it's a problem and for now i can't see a reason why putting the object send by the kinvey-backend inside this object. (On ios kinvey sends the raw data)

Best, Nico

sorry pushing this topic, but it's an important part for the application. Any new on this? :)

best, Nico
Nico, let me pick an engineers brain on this and get back to you first thing tomorrow morning.

Nico, I apologize for the long follow up.

Have you taken a look at the object in the debugger? I'll follow up with our engineer Ed about this, but before I do, can you confirm that you have read the documentation around Titanium in our Dev center for sending push notifications? You can find that over here:

i've read the documention (more than once :) ), but the example isn't really helpfull for me.

Using the Push-Console on Kinvey the result is:

>[INFO] : {"msg":"hallo kinvey","gcm":{"messageType":"gcm"},"collapse_key":"do_not_collapse","from":"251626472384"}

Using the backend (business logic):

with this:

var androidPayload = {foo : "bar"};

push.sendPayload(doc, iOSAps, iOSExtras, androidPayload);

the result is:


As you can see it's strange.

And THATS my problem at the moment. Nothing more, nothing less. :)

Just to be clear:

using this with the terminal to test it:

curl -X POST \

-H "Authorization: key= XYZXYZ" \

-H "Content-Type: application/json" \

-d '{

"registration_ids": [



"data": {

"message": "whats up",

"alert" : "hi"


}' \

It work's like a charme, too. Thus MY RESULT is that Kinvey does something about the raw-message send to the client. - And i don't have any clue why you do so.


Let's take this discussion to email, I'll shoot you a message and we can take a dive into your code so I can get a bit more visibility into the problem.
Login or Signup to post a comment