这是从服务器发送消息的方式:
//Queue Android GCM Notification
_pushService.QueueNotification(NotificationFactory.AndroidGcm()
.ForDeviceRegistrationId(device)
.WithCollapseKey("LATEST")
.WithJson("{\"alert\":\"" + message + "\",\"badge\":\"7\"}"));
我收到 Intent,如何获取消息?我试过了:
Log.d(TAG, "" + intent.getStringExtra("{\"alert\":\""));
Log.d(TAG, "" + intent.getStringExtra("LATEST"));
Log.d(TAG, "" + intent.getStringExtra("data"));
全部为空,消息文本值的键是什么?