Corona Cloud Push Notifications

Just wondering what is the “payload” field when sending out a notification via Corona Cloud? Is this a way to send data to your app without it being visible to the user in the notification itself? If so, is this somehow accessible within launchArgs?

Edit: Looks like the payload is accessible with event.custom in the notification listener. However, how do I access it from a cold start within the launchArgs?

I read that you can do this on iOS push notifications: 

if launchArgs and launchArgs.notification then -- Process the notifications table within launchArgs end

However on Android there is no “notification” key within the launchArgs table. Is this a bug with daily build 1105 or am I missing something?

Really no-one?

Android should also have the launch args on start up.   If not, it should trigger the notification listener.

I am getting push notifications succesfully and there is a “custom” index in the event table within the notification but nothing in “launchArgs” I will keep playing with it.

Build 2013.1107

Windows 7

Android

I am receiving launch args but it is mostly blank:

local launch_args= . . .

if (launch_args) then

native.showAlert(“launch”,json.encode(launch_args),{“ok”})

gives me an alert 


“Launch”

{“androidIntent”:{“categories”:[],“url”:“action”:“android.intent.action.MAIN”,“extras”:[]},“url”:""}

OK


I get the same launch args when the app is launched normally or when it is launched via a push notification.

Also , I have a notification listener that does receive a type of “remoteRegistration” but that’s it, no other type gets fired. 

Really need to figure a way to get this working. 

Chris

Launch Args : 

To further the discussion regarding launch args I thought I would post the ruby on rails code I use to send a Push through google. What am I doing wrong???  I get the notification but can’t seem to read the custom data.

  def send_Note(deviceid,message,extra)

     url="[url=“https://android.googleapis.com/gcm/send”]https://android.googleapis.com/gcm/send[/url]"

     uri= URI.parse (url)

      https= Net::HTTP.new(uri.host,uri.port) 

     https.use_ssl=true

     https.verify_mode= OpenSSL::SSL::VERIFY_NONE

     request=Net::HTTP::Post.new(uri.path, initheader = {‘Content-Type’=>‘application/json’, ‘authorization’ => ‘key=MYKEY’})

   reqbody=

    {

     “registration_ids”=> [deviceid],

            “data”=> {

            “alert”=> [message],

            “sound”=> “notification.wav”,

            “custom”=> {

                     “messageid” => [extra]

       } }  }

  

     request.body= reqbody.to_json

        resp = https.request(request)

      

   end

PLEASE HELP

Chris

@ebookren I’m confused.  This thread is about corona cloud push notifications. You’re post doesn’t look like it has anything to do with Corona Cloud.

Please open this in a new thread if you are just concerned about Android push and the custom table so this thread stays on target.

I’m actually concerned about Launch Args, which is a topic related to corona cloud push notifications  My post was directly related to Into-it-games’s post, which was never addressed. Your response

“Android should also have the launch args on start up”  shows you know something about the Launch Args.  Considering both into-it-games and I are having trouble getting Launch Args, and we are the only ones in this thread, I thought it was a safe place to post my question.  My post from the 21st was never responded to after a week so I thought I would post again with more detail.  Your “wrong thread” message was posted the same day.  

Thank you for your response. I will look for assistance in other forums.  When and if I end up using Corona Cloud in the future  I’ll be sure to stop by this forum again. 

I read that you can do this on iOS push notifications: 

if launchArgs and launchArgs.notification then -- Process the notifications table within launchArgs end

However on Android there is no “notification” key within the launchArgs table. Is this a bug with daily build 1105 or am I missing something?

Really no-one?

Android should also have the launch args on start up.   If not, it should trigger the notification listener.

I am getting push notifications succesfully and there is a “custom” index in the event table within the notification but nothing in “launchArgs” I will keep playing with it.

Build 2013.1107

Windows 7

Android

I am receiving launch args but it is mostly blank:

local launch_args= . . .

if (launch_args) then

native.showAlert(“launch”,json.encode(launch_args),{“ok”})

gives me an alert 


“Launch”

{“androidIntent”:{“categories”:[],“url”:“action”:“android.intent.action.MAIN”,“extras”:[]},“url”:""}

OK


I get the same launch args when the app is launched normally or when it is launched via a push notification.

Also , I have a notification listener that does receive a type of “remoteRegistration” but that’s it, no other type gets fired. 

Really need to figure a way to get this working. 

Chris

Launch Args : 

To further the discussion regarding launch args I thought I would post the ruby on rails code I use to send a Push through google. What am I doing wrong???  I get the notification but can’t seem to read the custom data.

  def send_Note(deviceid,message,extra)

     url="[url=“https://android.googleapis.com/gcm/send”]https://android.googleapis.com/gcm/send[/url]"

     uri= URI.parse (url)

      https= Net::HTTP.new(uri.host,uri.port) 

     https.use_ssl=true

     https.verify_mode= OpenSSL::SSL::VERIFY_NONE

     request=Net::HTTP::Post.new(uri.path, initheader = {‘Content-Type’=>‘application/json’, ‘authorization’ => ‘key=MYKEY’})

   reqbody=

    {

     “registration_ids”=> [deviceid],

            “data”=> {

            “alert”=> [message],

            “sound”=> “notification.wav”,

            “custom”=> {

                     “messageid” => [extra]

       } }  }

  

     request.body= reqbody.to_json

        resp = https.request(request)

      

   end

PLEASE HELP

Chris

@ebookren I’m confused.  This thread is about corona cloud push notifications. You’re post doesn’t look like it has anything to do with Corona Cloud.

Please open this in a new thread if you are just concerned about Android push and the custom table so this thread stays on target.

I’m actually concerned about Launch Args, which is a topic related to corona cloud push notifications  My post was directly related to Into-it-games’s post, which was never addressed. Your response

“Android should also have the launch args on start up”  shows you know something about the Launch Args.  Considering both into-it-games and I are having trouble getting Launch Args, and we are the only ones in this thread, I thought it was a safe place to post my question.  My post from the 21st was never responded to after a week so I thought I would post again with more detail.  Your “wrong thread” message was posted the same day.  

Thank you for your response. I will look for assistance in other forums.  When and if I end up using Corona Cloud in the future  I’ll be sure to stop by this forum again.