search

Home  >  Q&A  >  body text

android - 关于极光推送的通知的内容取出来的问题

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

巴扎黑巴扎黑2888 days ago583

reply all(3)I'll reply

  • 怪我咯

    怪我咯2017-04-17 17:35:21

    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

    reply
    0
  • 迷茫

    迷茫2017-04-17 17:35:21

    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);
    }

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 17:35:21

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

    reply
    0
  • Cancelreply