From the Google cloud push tutorials, I am running this code when a user first starts the app:
GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this);
final String regId = GCMRegistrar.getRegistrationId(this);
if (regId.equals(""))
{
GCMRegistrar.register(this, "566530471892");
}
else
{
//Log.v(TAG, "Already registered");
}
But what I don’t understand is how to send that regId variable to the server so I can save it along with the new user id.
Or am I misunderstanding how this is supposed to work? Is that not the correct thing to do here?
Thanks!
You do it by whatever means you are otherwise communicating with your server, such as a Web service call.