pushwoosh error

please help… 

i was follow dis site for pushwoosh…

the code is100% same…

http://docs.pushwoosh.com/docs/corona-sdk

its work… but when i open the notification… it will show dis…

help me fix it… 

it will show like dis…

help me fix it

Do you see this line of code:

native.showAlert( "remote notification", json.encode( event.data ), { "OK" } )

It’s in the onNotification() function. It create a native alert box (which you see in your screen shot) and it takes the data from event.data (a Lua table of data bits) and encodes it to a JSON string. This is a technique used to quickly display the contents of a table to you.

The idea is that you would see what values are in event.data (event is a table passed to the function, data is a table of the actual push notification data) and then you would write your own code replacing the native.showAlert() with whatever you want to do with the push notification data. Basically you have the following databits to work with:

event.data.type = "remote" event.data.name = "notification" -- this is a sub-table named event.data.androidGcmBundle = {} event.data.androidGcmBundle["collapse\_key"] = "do\_not\_collapse" event.data.androidGcmBundle.p = "{" event.data.androidGcmBundle.from = "390127053882" event.data.androidGcmBundle.alert = "sfwfq" event.data.androidGcmBundle.pw\_msg = "1" event.data.custom = nil event.data.alert ="sfwfq" event.data.applicationState = "active"

You know it’s a remote (i.e. push) notification event. The text of the push is the string “sfwfq” and that the app was active (i.e. on the device’s screen, not backgrounded) when the event came in. PushWoosh did not provide a custom table (which seems where the stuff in the androidGcmBundle table should have been.)

It also provided a list of data in the androidGcmBundle sub table for you to use.

Now what you do with the push once you get it is up to you, but eventually you will remove/replace that native.showAlert() call with whatever you want to do. Perhaps you know who user 390127053882 is and can look up their name and perhaps do a native.showAlert() showing “From Joe AppUser” as the title of the alert and the alert text as the body of an alert. It’s really all up to you.

Rob

it will show like dis…

help me fix it

Do you see this line of code:

native.showAlert( "remote notification", json.encode( event.data ), { "OK" } )

It’s in the onNotification() function. It create a native alert box (which you see in your screen shot) and it takes the data from event.data (a Lua table of data bits) and encodes it to a JSON string. This is a technique used to quickly display the contents of a table to you.

The idea is that you would see what values are in event.data (event is a table passed to the function, data is a table of the actual push notification data) and then you would write your own code replacing the native.showAlert() with whatever you want to do with the push notification data. Basically you have the following databits to work with:

event.data.type = "remote" event.data.name = "notification" -- this is a sub-table named event.data.androidGcmBundle = {} event.data.androidGcmBundle["collapse\_key"] = "do\_not\_collapse" event.data.androidGcmBundle.p = "{" event.data.androidGcmBundle.from = "390127053882" event.data.androidGcmBundle.alert = "sfwfq" event.data.androidGcmBundle.pw\_msg = "1" event.data.custom = nil event.data.alert ="sfwfq" event.data.applicationState = "active"

You know it’s a remote (i.e. push) notification event. The text of the push is the string “sfwfq” and that the app was active (i.e. on the device’s screen, not backgrounded) when the event came in. PushWoosh did not provide a custom table (which seems where the stuff in the androidGcmBundle table should have been.)

It also provided a list of data in the androidGcmBundle sub table for you to use.

Now what you do with the push once you get it is up to you, but eventually you will remove/replace that native.showAlert() call with whatever you want to do. Perhaps you know who user 390127053882 is and can look up their name and perhaps do a native.showAlert() showing “From Joe AppUser” as the title of the alert and the alert text as the body of an alert. It’s really all up to you.

Rob