The_Martian
The_Martian

Reputation: 3767

Where and how to save Android GCM project ID and api key?

I am working on Android gcm project. The docs recommend to save the project ID and api key in a server for security purposes. But all of the GCM examples in the web don't do that. How efficient would that be to save them in a server and grab them when needed in the app? Has anyone done that in any project? Can someone give me a snippet of efficient code? Thank you

Upvotes: 0

Views: 175

Answers (1)

Marcin Orlowski
Marcin Orlowski

Reputation: 75619

GCM implementations require you to have server side part that will be sending data to your devices. This acts as middleware between devices and GCM servers. Server side can be PHP/Python etc scripts, whatever. And to these scripts need these data to be able to send anything to your devices via Google servers. So your app is NOT fetching anything. Like this:

enter image description here.

Upvotes: 2

Related Questions