Trouble understanding json.encode with Corona SDK
Hi, I managed to get Pushes working straight away, thanks to your decent tutorials... Thjere's just one thing I can't get my head around.
In your Corona SDK LUA code, you have ' native.showAlert("Message from Geek-o-Meter", json.encode( launchArgs.notification ), { "OK" } )'
and
native.showAlert( "Message from Geek-o-Meter", json.encode( event ), { "OK" } )
...A launchArgs and a 'remote' identifier, which is great, but my Push is getting the whole event table passed to the notification event.
So my actual alert looks something like this:
{"badge":3,"type":"remote","name":"notification","custom":"sound":"default","alert":"THIS IS MY ACTUAL NOTIFICATION","applicationState":"inactive"}
In a nutshell, I'd just like to pass my message to the alert, without the extra table data/strings, but I don't know how to extrapolate the bits I need. Can you help?
Thanks
Please sign in to leave a comment.
Comments
1 comment