I used the demo GCM example provided by Google, it works fine, except it sends by default message “GCM: you received message!”, I would like to alert to send instead a string, but dont know how?
Server code:
Message message =new Message.Builder().addData("data", "hello client").build();
Result result = sender.send(message, registrationId, 5);
Client Code:
public void onReceive(Context context, Intent intent) {
String details = intent.getStringExtra("data");
System.out.println("Message="+details);
}
does any body have an example of GCM example with payload?
man, i found the show notification message is local ,not from the server…..
you will find the program set message to R.string.gcm_message…..