質問

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