android - 關于極光推送的通知的內容取出來的問題
問題描述
如何取出極光推送的通知的內容,我試了好久,找不到怎么取出來,我是想取出所有的消息的內容,保存到本地自定義的消息中心。
問題解答
回答1:你打印下返回的json格式String,如果有值說明是你的取值方法有問題了,試試fastJson或者GSON
回答2: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);}回答3:
我也遇到了這個問題,是這樣取出通知的內容的:String result = bundle.getString(JPushInterface.EXTRA_ALERT);
相關文章:
