简体   繁体   English

使用NodeJS对Google推送通知执行的操作

[英]Actions on Google Push Notifications with NodeJS

I'm struggling through the official Documentation of how to setup push notifications in Actions on Google. 我正在努力查看有关如何在Google Actions中设置推送通知的官方文档 I did find this Github project here . 我确实在这里找到了这个Github项目。

However I'm still unclear on the exact steps of setting up an intent in dialogflow to acheive this. 但是,我仍然不清楚在dialogflow中设置意图以实现此目的的确切步骤。 I am using webhooks for all of my intents currently. 我目前正在将webhooks用于所有意图。

Question #1: 问题1:

On the official documentation it talks about referencing the event actions_intent_PERMISSION . 在官方文档中,它谈到了引用事件actions_intent_PERMISSION However, I have an intent set up for this event already when i ask to get the users location. 但是,当我要求获取用户位置时,我已经为此事件设置了一个意图。 Do I set up a separate intent to handle the user permission for push notifications, or do I somehow handle both permission grants in a single intent? 我是否要设置单独的意图来处理用户对推送通知的许可,还是以某种方式在单个意图中同时处理两个许可授予?

Question #2: 问题2:

How many intents do I need to properly execute this user flow? 我需要多少个意图才能正确执行此用户流?

  • DF: "do you want be notified of severe weather" DF:“您想收到恶劣天气的通知吗”
  • User: "yes" 用户:“是”
  • DF: "i'll need to get permission to send you notifications, is that ok?" DF:“我需要获得许可才能向您发送通知,可以吗?”
  • List "yes" 列出“是”
  • * how many intents occur here * *这里有多少个意图*

What I'm hoping to find is a more concrete example of how to set up a push notification on google actions using dialogflow. 我希望找到一个更具体的示例,说明如何使用dialogflow在Google动作上设置推送通知。

Nick Felker had a good link, I'm not sure how I missed this example, but it is a much more clear example of how to build out push notifications in dialogflow with Nodejs fulfillment. 尼克·费尔克(Nick Felker)的链接很好,我不确定我如何错过这个示例,但是这是一个更加清晰的示例,说明了如何在Nodejs实现的对话框流中构建推送通知。

Thank you for the link: https://github.com/actions-on-google/dialogflow-updates-nodejs/blob/master/functions/index.js 感谢您的链接: https : //github.com/actions-on-google/dialogflow-updates-nodejs/blob/master/functions/index.js

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

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