Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,325 members, 7,808,097 topics. Date: Thursday, 25 April 2024 at 07:09 AM

Has Anyone Here Implemented Google Cloud Messaging On Android? - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Has Anyone Here Implemented Google Cloud Messaging On Android? (1109 Views)

Android Programming With Google Cloud Chat - Expert / Our Google Cloud Developer Challenge App- Prep Jambites / Ask Africa - My Google Cloud Developer Challenge Entry (2) (3) (4)

(1) (Reply) (Go Down)

Has Anyone Here Implemented Google Cloud Messaging On Android? by Javanian: 9:39pm On Sep 23, 2013
Please, has anyone here implemented Google Cloud Messaging on Android? tongue
Re: Has Anyone Here Implemented Google Cloud Messaging On Android? by Javanian: 11:10am On Sep 24, 2013
sad
Re: Has Anyone Here Implemented Google Cloud Messaging On Android? by nollyj: 11:25am On Sep 24, 2013
Do you have a problem using Google Cloud Messaging on android or you just want to check if someone has used it before? If it is the former you can share your problem and someone might be of help.
Re: Has Anyone Here Implemented Google Cloud Messaging On Android? by Javanian: 1:39pm On Sep 24, 2013
Okay here it goes,

I am trying to create a GCM server for a notification system for an Android app, i have read the brief explanation they gave here http://developer.android.com/google/gcm/server.html. Asked on stackoverflow and i was advised to use GCM HTTP. Fortunately, they had code implementation samples in Java (servlets) here http://code.google.com/p/gcm/source/browse/#git%2Fsamples But i seem to be missing something.

Assuming, i want to build something like an email app or an I.M app like whatsapp. So each time a user gets a new email, my server sends a notification via GCM to my android app installed on the users phone, how do i do this? i know its probably going to be sent in JSON format and the client side parses the data it sends and pushes it as a notification. But how do i send the info i want, lets say this is the data i want to push to the user

"operation": "new_email",
"username": "nollyj",
"subject": "Android app developer"
"email" : "nollj@nairaland.com"
body: "hi"

Please how exactly can i do this?, so far, I'm i on track?
Re: Has Anyone Here Implemented Google Cloud Messaging On Android? by Javanian: 1:59pm On Sep 24, 2013
Okay, its getting a bit clearer now, just a bit tongue

After reading this http://developer.android.com/google/gcm/http.html

http://developer.android.com/google/gcm/http.html

I was told to make a POST request to https://android.googleapis.com/gcm/send.

in this format


{ "data": {
"operation": "new_email",
"username": "nollyj",
"subject": "Android app developer"
"email" : "nollj@nairaland.com"
"body: "hi"
},
"registration_ids": ["4"]
}

It brings a few more questions like, how do i know which user has which registration id,

example how do i know the registration_id of nollyj==4

where are this registration ids even stored?

what is the role of all the code i got from here http://code.google.com/p/gcm/source/browse/#git%2Fsamples
Re: Has Anyone Here Implemented Google Cloud Messaging On Android? by Javanian: 3:39pm On Sep 24, 2013
Thanks, i think i get it now cheesy wink cool tongue
Re: Has Anyone Here Implemented Google Cloud Messaging On Android? by nollyj: 5:18pm On Sep 24, 2013
Javanian: Thanks, i think i get it now cheesy wink cool tongue
Nice that you have solved your problem. Just coming back now.
Re: Has Anyone Here Implemented Google Cloud Messaging On Android? by AZeD1(m): 10:55pm On Sep 24, 2013
Javanian: Thanks, i think i get it now cheesy wink cool tongue
You should post what you figured out for others to learn from your experience.

(1) (Reply)

Why Do Most People Say Programming Is Easy To Learn When In Reality It Is... / Micropython: Python For Microcontrollers / Mobileapps Developer Needed !!!

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 12
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.