使用解析Android发送推送通知时未获取数据

使用解析Android发送推送通知时未获取数据,android,parse-platform,Android,Parse Platform,我正在使用PushService.subscribe(context,channel,NotificationActivity.class)订阅频道以获取推送通知。我能够获取推送通知,但无法在通知活动中获取附加数据。这是我的密码 JSONObject data = new JSONObject(); data.put("action","com.example.myapp.UPDATE_STATUS") data.put("postTitle",result.get(0).getTitle()

我正在使用
PushService.subscribe(context,channel,NotificationActivity.class)
订阅频道以获取推送通知。我能够获取推送通知,但无法在
通知活动
中获取附加数据。这是我的密码

JSONObject data = new JSONObject();
data.put("action","com.example.myapp.UPDATE_STATUS")
data.put("postTitle",result.get(0).getTitle() );
data.put("description", result.get(0).getDescription());

ParsePush push = new ParsePush();
push.setChannel(tag);
push.setData(data);
push.setMessage("Meassge sent is"+tag);
push.send();

NotificationActivity
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_notification);
ParseAnalytics.trackAppOpened(getIntent()); 
Intent intent = getIntent();
Bundle extras = intent.getExtras(); 
JSONObject jsonData1;
jsonData1 = new JSONObject(intent.getExtras().getString( "com.parse.Data" ));
while (itr.hasNext()) {
     String key = (String) itr.next();
         Log.d("NotificationActivity Logs", "..." + key + " => " +                      jsonData1.getString(key));
}

在输出(Logcat)中,我只得到两个键
alert
push_hash
,但没有给出我设置的任何其他键,比如
title
description
,我刚刚找到了解决方案。我不应该使用setMessage()。当使用setData时,它已经有一个标题字段来设置消息。因此,要么使用setData,要么使用setMeassge.3小时。谢谢你的宝贵意见!