【问题标题】:Alexa skills events not firing when hosted in web service在 Web 服务中托管时,Alexa 技能事件不会触发
【发布时间】:2020-07-03 12:11:27
【问题描述】:

我有调用我创建的 Web 服务的自定义技能。我能够启动并获得其他意图,但是当我的技能用户更改通知权限时,我没有收到通知。我需要他的通知事件来获取用户 ID,以便稍后由其他服务发送推送通知。

下面是我的json文件:

{
  "manifest": {
    "apis": {
      "custom": {
        "endpoint": {
          "uri": "https://pathToMyService",
          "sslCertificateType": "Wildcard"
        },
        "interfaces": []
      }
    },
    "events": {
      "publications": [
         { "eventName": "AMAZON.TrashCollectionAlert.Activated" },
         { "eventName": "AMAZON.MessageAlert.Activated" }
       ],
       "subscriptions": [
         { "eventName": "SKILL_PROACTIVE_SUBSCRIPTION_CHANGED" },
         { "eventName": "SKILL_ENABLED" },
         { "eventName": "SKILL_DISABLED" },
         { "eventName": "SKILL_PERMISSION_ACCEPTED" },
         { "eventName": "SKILL_PERMISSION_CHANGED" },
       ],
       "regions": {
         "NA": {
           "endpoint": {
             "uri": "https://pathToMyService",
             "sslCertificateType": "Wildcard"
           }
         }
       },
       "endpoint": {
         "uri": "https://pathToMyService",
         "sslCertificateType": "Wildcard"
       }
     },
     "manifestVersion": "1.0",
     "permissions": [
       { "name": "alexa::devices:all:notifications:write" }
     ],
     "publishingInformation": {
       "locales": {
         "en-US": { "name": "Test Events" }
       }
     }
   }
 }

下面是 Launch 请求:我截断了 applicatioId、userID、consentToken、deviceId、apiAccessToken

{"version":"1.0","session":{"new":true,"sessionId":"amzn1.echo-api.session.60ad1e76-0872-4e10-b79d-7144cdf3e1c9","application" :{"applicationId":"amzn1.ask.skill.59d60703"},"user":{"userId":"amzn1.ask.account.AGB7EOY","permissions":{"consentToken":"eyJ0eXAiOiJKV1"}} },"context":{"System":{"application":{"applicationId":"amzn1.ask.skill.59d60703"},"user":{"userId":"amzn1.ask.account.AGB7EOY" ,"permissions":{"consentToken":"eyJ0eXAiOiJKV1Qi"}},"device":{"deviceId":"amzn1.ask.device.AFNXDZOAEMFDFKK","supportedInterfaces":{}},"apiEndpoint":"@987654321 @","apiAccessToken":"eyJ0eXAiOiJKV1Qi"}},"request":{"type":"LaunchRequest","re​​questId":"amzn1.echo-api.request.adb318af-1977-4b36-b8ad-0bb4352fa563", "timestamp":"2020-03-22T23:37:55Z","locale":"en-US","shouldLinkResultBeReturned":false}}

谢谢

【问题讨论】:

    标签: alexa alexa-skills-kit alexa-skill alexa-app


    【解决方案1】:

    我解决了这个问题:当我使用 Skill.json 文件更新时 ask api update-skill -s amzn1.ask.skill.59d6 -f Test.json 它没有正确更新。我今天收到最新消息时注意到了 ask api get-skill -s amzn1.ask.skill.59d6 >Test2.json 缺少活动部分。我添加回来并重新申请,它现在可以工作了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-11-25
      • 1970-01-01
      • 1970-01-01
      • 2017-04-21
      • 2020-11-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多