0
votes

I am making an ios application and using push notifications. When I copy and paste the following notificatiom everything works fine.

{"aps":{"alert":"Temperature reached to 37.3.Board: raspberrypi.Time: 2015-07-09T14:02:02.0000000","badge":1,"sound":"default"},"AdditionalInfo":"","SensorType":"Temperature"}

When I use the following notification it says payload has been pushed, but I never receive the notification.

{"aps":{"alert":"Humidity reached to 69.0.Board: onshore_raspberrypi.Time: 2015-07-09T10:31:00.0000000","badge":1,"sound":"default"},"AdditionalInfo":"","SensorType”:”Humidity”}

And at the bottom right corner I get the following message: "malformed 187". The link to the screen shot is below.

Screen shot of push notification

What does malformed mean? And how I can fix it?

1

1 Answers

0
votes

Your second string is an invalid JSON string. Use a site like this to validate.

You had curly quotation marks instead of straight quotation marks in some places. I removed and replaced them with the correct ones. The following JSON should work!

{"aps":{"alert":"Temperature reached to 37.3.Board: raspberrypi.Time: 2015-07-09T14:02:02.0000000","badge":1,"sound":"default"},"AdditionalInfo":"","SensorType":"Humidity"}