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

asked 15 Jul '14, 23:58
diggler1's gravatar image

diggler1
112

Hi,

This is just how Corona passes push notification to the app. Instead of passing json.encode(event), simply get the message you need from json payload. Something like:

native.showAlert( "Message from Geek-o-Meter", event.alert, { "OK" } )

permanent link
answered 16 Jul '14, 08:15
shader's gravatar image

shader
3.9k7

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×141
×13
×12

question asked: 15 Jul '14, 23:58

question was seen: 1,355 times

last updated: 16 Jul '14, 08:15