android - 關(guān)于極光推送的通知的內(nèi)容取出來(lái)的問(wèn)題
問(wèn)題描述
如何取出極光推送的通知的內(nèi)容,我試了好久,找不到怎么取出來(lái),我是想取出所有的消息的內(nèi)容,保存到本地自定義的消息中心。
問(wèn)題解答
回答1:你打印下返回的json格式String,如果有值說(shuō)明是你的取值方法有問(wèn)題了,試試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:
我也遇到了這個(gè)問(wèn)題,是這樣取出通知的內(nèi)容的:String result = bundle.getString(JPushInterface.EXTRA_ALERT);
相關(guān)文章:
1. 環(huán)境搭建 - anaconda 創(chuàng)建python2.7環(huán)境中打開(kāi)編譯器確是3.6版本2. python - 數(shù)據(jù)與循環(huán)次數(shù)對(duì)應(yīng)不上3. linux - Ubuntu下編譯Vim8(+python)無(wú)數(shù)次編譯失敗4. list - python 求助5. javascript - 微信網(wǎng)頁(yè)開(kāi)發(fā)從菜單進(jìn)入頁(yè)面后,按返回鍵沒(méi)有關(guān)閉瀏覽器而是刷新當(dāng)前頁(yè)面,求解決?6. mysql - C#連接數(shù)據(jù)庫(kù)時(shí)一直這一句出問(wèn)題int i = cmd.ExecuteNonQuery();7. 求救一下,用新版的phpstudy,數(shù)據(jù)庫(kù)過(guò)段時(shí)間會(huì)消失是什么情況?8. mysql replace 死鎖9. python - TypeError: tryMsgcode() takes exactly 2 arguments (0 given)10. extra沒(méi)有加載出來(lái)
