Ascorbin Ascorbin - 3 months ago 47
Android Question

Retrieve "content" of GCM message Intent.

This is how the message is being sent from the server:

//Queue Android GCM Notification
.WithJson("{\"alert\":\"" + message + "\",\"badge\":\"7\"}"));

I receive the Intent, how do I get the message? I tried:

Log.d(TAG, "" + intent.getStringExtra("{\"alert\":\""));
Log.d(TAG, "" + intent.getStringExtra("LATEST"));
Log.d(TAG, "" + intent.getStringExtra("data"));

All are null, whats the key for the message text value?


Got it, its

Bundle b = intent.getExtras();
Set<String> allThatsInThere = b.keySet();