2- Configurar ApiKey (Server key, desde API console) y SenderId (project id desde API Console)
3- Completar el titulo y mensaje, y darle al boton "Send GCM..."
Desde la app, para registrar el token:
private void sendRegistrationIdToBackend() {
String url = "http://gcm4public.appspot. com/registergcmclient? senderId=" + SENDER_ID + "®istrationId=" + regid;
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(url);
try {
httpclient.execute(httpget);
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
No hay comentarios:
Publicar un comentario