Christopher Lawless
Christopher Lawless

Reputation: 1087

Correctly formatting GCM notifications?

I'm currently trying out the google cloud messaging service with its sample application "Guestbook." https://developers.google.com/cloud/samples/mbs/

I'm attempting to send notifications that should appear as a simple "hello" toast on screen for about 5 seconds.Doing this from the project settings page (pictured here)works.Perhaps i've misinterpreted what this for. settings screen, allows me to broadcast a message to all

However my attempts to do it manually via fiddler2 cause the guestbook client application to crash instead of making the intended toast flash up onscreen.

Here is an example of the POST request i used to attempt a push notification my attempts to push a notification to my registered device

I have also done other variations of the above where i have included "topicId:_broadcast" to no avail.

Is there something in the formatting that i have wrong? or missing information i should have included.

Upvotes: 0

Views: 189

Answers (1)

Eran
Eran

Reputation: 393851

You got the format a bit wrong. It should be :

{
  "registration_ids":["xxx", "yyy"],
  "data": {
    "message": "test",
    "duration": "5"
  }
}

Upvotes: 1

Related Questions