Question

With the Urban airship's library, I was able to implement the push notification ok. Which will trigger the onReceive() method every time I send push a message from a server.

But when I switch to use PushRich notification, whenever I send out a rich message, it won't triiger the onReceive() method.

I want to be able to achieve the same way it dose with the push notification in here. I tried the richpush simple code from the website, but it seems to be having the same problem.

The fact that I think its possible its because from the sample code onReceive() method has the following code in it.

// Ignore any non rich push notifications
        if (!RichPushManager.isRichPushMessage(intent.getExtras())) {
            return;
        }

Would it mean, it should send intent when we send rich push from server ?

Was it helpful?

Solution

Problem has been solved. After more digging into the Urban airship library. The rich message that contains HTML is actually be put into part of the push message JSON object. Looks like such in a simple push message

{
"audience" : { "tag" : [ "tag1", "tag2" ] },
"device_types" : [ "ios" ],
"notification" : { "alert" : "New message!" },
"message" : {
    "title" : "Message title",
    "body" : "<Your message here>",
    "content_type" : "text/html"
}

}

The "message" object is actually the Rich message itself. So therefore, catching the intent for a simple push message can from then determine if a rich message exist in the intent.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top