Вопрос

I know there is event listener in TriggerIo to catch received push notifications from Parse:

forge.event.messagePushed.addListener(function (msg) {
    alert(msg.alert);
});

But the 'msg' object contains only 'alert' and 'sound' keys...

Is there a way to receive at least a channel name to which push notification was sent? I need this to decide which view to open in my app as each channel has it's own destination. And if this is not possible, maybe there is another way to do this?

P.S I suppose it could be done by inserting some kind of 'keyword' into message it self, but I would rather avoid it.

Это было полезно?

Решение

I just realised, that there is a way to send so called JSON payload via Parse push submission form.

{
   "alert" : "My message",
   "additional" : "data"
}

More info: https://parse.com/questions/json-format-to-send-notification-from-parse

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top