Sub btnSend_Action
Dim keys As string = "xxxxxxxx" ' device registration id
Dim apikey as string = "xxxxxxxx"
Dim json As JSONGenerator
Dim m As Map
m.Initialize
m.Put("registration_ids", keys)
Dim data As Map
data.Initialize
data.Put("data", "Yes")
'you can add more fields to data and then read them on the device.
m.Put("data", data)
json.Initialize(m)
Dim job As HttpJob
job.Initialize("send message", Me)
job.PostString("https://android.googleapis.com/gcm/send", json.ToString)
job.GetRequest.SetContentType("application/json")
job.GetRequest.SetHeader("Authorization", "key=" & apikey)
End Sub