android - 关于极光推送的通知的内容取出来的问题
巴扎黑
巴扎黑 2017-04-17 17:33:21
0
3
582

如何取出极光推送的通知的内容,我试了好久,找不到怎么取出来,我是想取出所有的消息的内容,保存到本地自定义的消息中心。

巴扎黑
巴扎黑

reply all(3)
刘奇

You print the returned json format String. If there is a value, it means there is a problem with your value method. Try fastJson or GSON

迷茫
if (JPushInterface.ACTION_MESSAGE_RECEIVED.equals(action)) {
    Bundle extras = intent.getExtras();
    if (null == extras)
        return;
    String title = extras.getString(JPushInterface.EXTRA_TITLE);
    String message = extras.getString(JPushInterface.EXTRA_MESSAGE);
    String extraJson = extras.getString(JPushInterface.EXTRA_EXTRA);
    LogUtils.d("Message title : " + title);
    LogUtils.d("Message content : " + message);
    LogUtils.d("Message extraJson : " + extraJson);
}
刘奇

I also encountered this problem. This is how to get the content of the notification:
String result = bundle.getString(JPushInterface.EXTRA_ALERT);

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template