Reputation: 22018
This is how the message is being sent from the server:
//Queue Android GCM Notification
_pushService.QueueNotification(NotificationFactory.AndroidGcm()
.ForDeviceRegistrationId(device)
.WithCollapseKey("LATEST")
.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?
Upvotes: 2
Views: 1508
Reputation: 22018
Got it, its
Bundle b = intent.getExtras();
Set<String> allThatsInThere = b.keySet();
Upvotes: 3