![](/img/trans.png)
[英]Monodroid Intent Service's BroadcastReceiver not firing OnReceive
[英]Can't receive intent from BroadcastReceiver 's onReceive for Rich Push notification
有了Urban飛艇的圖書館,我就可以實現推送通知了。 每當我從服務器發送推送消息時,該方法都會觸發onReceive()方法。
但是,當我切換為使用PushRich通知時,每當我發送豐富消息時,它都不會觸發onReceive()方法。
我希望能夠實現與此處的推送通知相同的方式。 我從網站嘗試了richpush簡單代碼,但似乎有同樣的問題。
我認為有可能這樣的事實,因為在示例代碼中onReceive()方法具有以下代碼。
// Ignore any non rich push notifications
if (!RichPushManager.isRichPushMessage(intent.getExtras())) {
return;
}
這是否意味着,當我們從服務器發送豐富推送時,它應該發送意圖?
問題已解決。 之后更多地進入市區飛艇圖書館。 實際上,包含HTML的豐富消息將被放入推送消息JSON對象的一部分。 在簡單的推送消息中看起來像這樣
{
"audience" : { "tag" : [ "tag1", "tag2" ] },
"device_types" : [ "ios" ],
"notification" : { "alert" : "New message!" },
"message" : {
"title" : "Message title",
"body" : "<Your message here>",
"content_type" : "text/html"
}
}
“消息”對象實際上是Rich消息本身。 因此,從那時起,捕獲簡單消息的意圖就可以確定意圖中是否存在豐富消息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.