You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

移除Widget面板组件后,Alexa Skill未收到UsagesRemoved请求

问题:Alexa Widget移除时无法接收UsagesRemoved请求

我用Java开发了一款Alexa Skill,目前正在进行带Widget功能版本的beta测试。已注册以下请求处理器:

  • UsagesInstalled
  • UsagesRemoved
  • UpdateRequest
  • InstallationError

Skill能正常接收并处理UsagesInstalled请求,但从Widget面板移除该Widget时,始终收不到UsagesRemoved请求。我确认处理器注册正确,因为该类的canHandle(HandlerInput)方法在处理其他请求时会输出日志。只要有请求发送到Skill,CloudWatch日志都会显示以“START RequestId:…”开头的消息,但移除Widget时,Skill完全没收到请求,CloudWatch也没有相关日志记录。

Widget清单中的相关配置:

"installStateChanges": "INFORM",
"updateStateChanges": "INFORM",

该问题在Echo Show 10和Echo Show 15设备上表现一致。

请问有什么解决思路?


Widget APL代码

{"type": "APL","version": "2023.2","extensions": [{"name": "DataStore","uri": "alexaext:datastore:10"}],"settings": {"DataStore": {"dataBindings": [{"namespace": "TeamAssist","key": "nextevent","dataBindingName": "DS_NextEvent","dataType": "OBJECT"}]}},"import": [{"name": "alexa-layouts","version": "1.7.0"}],"mainTemplate": {"parameters": ["payload"],"items": [{"type": "Container","height": "100%","items": [{"type": "AlexaBackground","colorOverlay": "true","backgroundImageSource": "${DS_NextEvent ? DS_NextEvent.backgroundImageURL : payload.nextEventDataSource.backgroundImageSource}"},{"type": "AlexaFooterActionButton","id": "nextEventWidgetLaunch","buttonText": "${payload.nextEventDataSource.headerButtonText}","primaryAction": [{"type": "SendEvent","arguments": ["openSkill"],"flags": {"interactionMode": "STANDARD"}}]},{"type": "Text","id": "eventDateText","text": "${DS_NextEvent ? DS_NextEvent.eventDate : payload.nextEventDataSource.eventDate}","textAlign": "center","paddingTop": "${viewportSizeClass == @viewportClassMediumLarge ? @spacingLarge : @spacingSmall}","fontSize": "${viewportSizeClass == @viewportClassMediumXSmall ? @fontSize2XSmall : @fontSizeSmall}","onMount": [{"type": "SendEvent","arguments": ["localizeDate","${DS_NextEvent.eventStartDateTime}"],"flags": {"interactionMode": "INLINE"}}]},{"type": "Text","text": "${DS_NextEvent ? DS_NextEvent.eventName : payload.nextEventDataSource.eventName}","textAlign": "center","paddingTop": "${viewportSizeClass == @viewportClassMediumLarge ? @spacingLarge : @spacingSmall}","fontSize": "${viewportSizeClass == @viewportClassMediumXSmall ? @fontSize2XSmall : @fontSizeSmall}"},{"type": "Text","text": " ","textAlign": "center","paddingTop": "${viewportSizeClass == @viewportClassMediumLarge ? @spacingLarge : @spacingSmall}","fontSize": "@fontSize2XSmall"},{"type": "Text","text": "${DS_NextEvent ? DS_NextEvent.eventLocation : payload.nextEventDataSource.eventLocation}","textAlign": "center","fontStyle": "italic","fontSize": "${viewportSizeClass == @viewportClassMediumXSmall ? @fontSize2XSmall : @fontSizeXSmall}"},{"type": "Text","text": "${DS_NextEvent ? DS_NextEvent.eventLocationDetails : payload.nextEventDataSource.eventLocationDetails}","textAlign": "center","fontStyle": "normal","fontSize": "${viewportSizeClass == @viewportClassMediumXSmall ? @fontSize2XSmall : @fontSizeXSmall}"},{"type": "AlexaFooterActionButton","id": "nextEventWidgetRefresh","buttonText": "${payload.nextEventDataSource.footerButtonText}","position": "absolute","bottom": 0,"primaryAction": [{"type": "SendEvent","arguments": ["refreshEvent"],"flags": {"interactionMode": "INLINE"}}]}]}]}}

Widget Manifest代码

{"manifest": {"id": "NextEventWidget","version": "1.0.0","presentationDefinitions": [{"url": "presentations/default.tpl"}],"installStateChanges": "INFORM","updateStateChanges": "INFORM","appliesTo": "${viewport.mode == 'HUB'}"},"packageVersion": "1.0","packageType": "APL_PACKAGE","publishingInformation": {"schemaVersion": "1.0","locales": {"en-US": [{"targetViewport": "WIDGET_M","metadata": {"name": "Team Assist Next Event Widget","description": "Display the next event from Teamsnap.","keywords": ["Team Assist","Teamsnap","TeamAssist"],"iconUri": "https://d3ozx4qyxcxwzd.cloudfront.net/default_icon.png","previews": ["https://d3ozx4qyxcxwzd.cloudfront.net/default_preview.png"]}}]}}}

内容的提问来源于stack exchange,提问作者Brian W

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.03 04:07:13