GCM connectivity using PostURL
Hi everyone,
Im trying to send data to Google Cloud Messaging server using zoho creator...
Here is what i have done so far...
P.S. - postfields is a JSON array.
- void api.apiCall()
- {
- httpheader = map();
- httpheader.put("Authorization", "key=A************************************");
- httpheader.put("Content-Type", "application/json");
- postfields = " {\" registration_ids\":[\"sEvg******************************\"],\"data\":{\"message\":\"my message\"}}";
- response = postUrl("https://android.googleapis.com/gcm/send", postfields, httpheader);
- info response;
}
I am getting bad request error.
I would really appreciate if somebody could help me out on this one...
Thanks.