I'm somewhat confused in how I'm supposed to structure the message body for a GCM push notification using PushSharp. The docs as well as the test files in the GitHub repo show what looks to be the message structure as this:
broker.QueueNotification (new GcmNotification {
RegistrationIds = new List<string> {
regId
},
Data = JObject.Parse ("{ \"somekey\" : \"somevalue\" }")
});
I've been using Postman for testing in which I send a message in the following JSON format to https://gcm-http.googleapis.com/gcm/send.
{
"to": "000-0000-mytoken-foo",
"notification" : {
"title" : "Push Test Notification",
"body" : "GCM Test Push",
"icon" : "icon",
"color" : "#FF4081"
}
}
Is the 'to'
and the 'notification'
sections of the message already taken care of by the framework? Based off the examples I've seen it seems as though I only need to enter the key:value pairs of the notification object but I can't seem to find where that is stated or an example of an actual message in the docs. I'm using the newest version (4.x) of PushSharp.