Hi guys,

Our build is based on the native Android guide... When the device has the application open, the push notification displays with all sorts of JSON data. Can someone explain what is going on?

Message looks a little like

{"onStart":false, "pw_msg":1, "from" : "340983209482304", "title": "this is a test message!"......etc }

Any help would be really appreciated!

Thanks

asked 21 Jun '15, 12:13
tomph's gravatar image

tomph
112

Sorry guys, I worked it out. When the notification comes through and the app is open, it is displayed as a Toast message... You need to parse the JSON data yourself, ie "title" is the body text.

permanent link
answered 21 Jun '15, 12:43
tomph's gravatar image

tomph
112

I am having the same issue. Can you please share more details as what needs to be done? Thx.

permanent link
answered 01 Jul '15, 20:17
safadig's gravatar image

safadig
11

How you resolved this issue? Please explain in detail

permanent link
answered 08 Jul '15, 07:15
chivchivatm's gravatar image

chivchivatm
111

i also want to know how to solve it please

permanent link
answered 18 Dec '15, 22:14
shopping's gravatar image

shopping
111

I think the problem is that you are getting a JSON string through that can then then be converted to an object. You are displaying the serialised JSON string rather than the object. As its a string it looks like a JSON object but isn't really.

No idea how you convert it to JSON in Java but in Javascript it would be

var JSONobject = JSON.parse(string).

This would convert the string back into the actual JS

and to convert out back to a string

var string = JSON.stringify(JSONobject)

Rob

permanent link
answered 23 Dec '15, 10:59
rwillett's gravatar image

rwillett
2015

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:

×446
×37
×12

question asked: 21 Jun '15, 12:13

question was seen: 1,170 times

last updated: 23 Dec '15, 10:59