How to get the location of an Amazon Echo from an Alexa Skill

时间:2016-07-11 20:09:48

标签: node.js amazon-web-services aws-lambda alexa-skills-kit

I know that Amazon does not directly provide developers with a way to get the location of the user's echo, but I was wondering if there was a way around this. I'm writing the skills in node, so I have run into node packages like geoip, but when I upload the skill to aws lambda, I get an error that says something along the lines of the ELF headers are not correct. Any assistance would be much appreciated!

1 个答案:

答案 0 :(得分:1)

您现在可以获取设备的地址,具体取决于客户的设备设置。

这是2017-04-05的新功能。有关新Amazon's blog post的信息,请参见Device Address API

我不确定你到底发生了什么,但这个新的API可以提供两个不同级别的地址(仅限国家/地区和邮政编码,或完整地址)。要获取其位置,您需要使用其他API将地址转换为位置坐标。这称为地理编码API,Google Maps API包含此功能(例如)。