简体   繁体   English

Trigger.io和Parse通道推送通知的其他数据用于深层链接

[英]Trigger.io and Parse channel push notification additional data for deep-linking

I know there is event listener in TriggerIo to catch received push notifications from Parse: 我知道TriggerIo中有事件侦听器,可以捕获从Parse接收到的推送通知:

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

But the 'msg' object contains only 'alert' and 'sound' keys... 但是'msg'对象仅包含'alert'和'sound'键...

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? 如果这不可能,也许还有另一种方法可以做到这一点?

PS I suppose it could be done by inserting some kind of 'keyword' into message it self, but I would rather avoid it. PS我想可以通过在自己的消息中插入某种“关键字”来实现,但是我宁愿避免这样做。

I just realised, that there is a way to send so called JSON payload via Parse push submission form. 我刚刚意识到,有一种方法可以通过Parse推送提交表单发送所谓的JSON有效负载。

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM