Backendless Push notification header passing issue

Hi

As i am using Push Notification using Backendless.

When i am publishing the push it will give me error like json invalid.

jsonData.headers={“android-ticker-text” = “You just got a push notification!”,

“android-content-title” = “This is a notification title”,

“android-content-text” = “Push Notifications are cool”}

How to write this in json format?

Please help me to sort this out.

Thanks

Have a look at sample project “Notifications/GooglePushNotifications” that is included with the Corona Simulator.  That sample project pushes a GCM (Google Cloud Messaging) notification to itself.  In particular, have a look at the “main.lua” file’s onTap() and sendNotification() functions.  These functions demonstrate how to format your JSON message and send the notification via a network.request() call.

I suggest that you first try to get this sample project working with Google Cloud Messaging service first before attempting to integrate this into your own project.  This is to verify that you’ve set up everything on the Google server side correctly.  You’ll need to set the “projectNumber” in the “config.lua”… and the “googleApiKey” and “googleRegistrationId” at the top of the “main.lua” file as well.  There are comments in the code to help you with this.

I hope this helps!

Hi Joshua,

I looked into the sample code and i write the valid json.

Now the push notification published to network.

It receive on devices but there don’t have any text. Only the app name come.

Can you please tell me what can i do for getting the ticker and title text of the push notification.

Thanks

That sample app shows you how to set the message.  We document it in the onTap() event function.  You set the message via the JSON’s “alert” field.  In that example, it will display a “Hello World!” message.

Have a look at sample project “Notifications/GooglePushNotifications” that is included with the Corona Simulator.  That sample project pushes a GCM (Google Cloud Messaging) notification to itself.  In particular, have a look at the “main.lua” file’s onTap() and sendNotification() functions.  These functions demonstrate how to format your JSON message and send the notification via a network.request() call.

I suggest that you first try to get this sample project working with Google Cloud Messaging service first before attempting to integrate this into your own project.  This is to verify that you’ve set up everything on the Google server side correctly.  You’ll need to set the “projectNumber” in the “config.lua”… and the “googleApiKey” and “googleRegistrationId” at the top of the “main.lua” file as well.  There are comments in the code to help you with this.

I hope this helps!

Hi Joshua,

I looked into the sample code and i write the valid json.

Now the push notification published to network.

It receive on devices but there don’t have any text. Only the app name come.

Can you please tell me what can i do for getting the ticker and title text of the push notification.

Thanks

That sample app shows you how to set the message.  We document it in the onTap() event function.  You set the message via the JSON’s “alert” field.  In that example, it will display a “Hello World!” message.

Hi! Joshua I want to implement Push from de GCM but i got few questions, my intention is to sent silent push like only data or user turn without alerting user and another thing i want to implement is collapsing notifications for example if i receive 3 push from the [key]=“Challenge” then instead of having 3 notifications i just want one that says 3 Challenge you have.

GCM offer this kind of push but i dont know how to implement it, another thing is i was testing the sample but how can i send push to this device from another or simple making a http request, because only tapping the screen i get the push but otherwise i receive the message that push  was sent succesfully but nothing happends.

thanks,

Rene Castillo 

from DR.

Corona doesn’t support silent GCM notifications.  This is partly due to Corona not supporting backgrounding (ie: running Lua while your app is suspended in the background), which is needed for silent notification handling.  However, you can do this yourself in Java via Corona Enterprise.  But it would be on you to write the notification receiving/handling code according to Google’s documentation.

Hi! Joshua I want to implement Push from de GCM but i got few questions, my intention is to sent silent push like only data or user turn without alerting user and another thing i want to implement is collapsing notifications for example if i receive 3 push from the [key]=“Challenge” then instead of having 3 notifications i just want one that says 3 Challenge you have.

GCM offer this kind of push but i dont know how to implement it, another thing is i was testing the sample but how can i send push to this device from another or simple making a http request, because only tapping the screen i get the push but otherwise i receive the message that push  was sent succesfully but nothing happends.

thanks,

Rene Castillo 

from DR.

Corona doesn’t support silent GCM notifications.  This is partly due to Corona not supporting backgrounding (ie: running Lua while your app is suspended in the background), which is needed for silent notification handling.  However, you can do this yourself in Java via Corona Enterprise.  But it would be on you to write the notification receiving/handling code according to Google’s documentation.