简体   繁体   English

Amazon Alexa技能集:如何打开应用程序并从中提取信息

[英]Amazon Alexa skills set : How to open an app and extract information from it

I am thinking of implementing a project using Alexa Skills Kit. 我正在考虑使用Alexa Skills Kit实施一个项目。
I couldn't figure out if its possible to open any random app in my mobile and get information from it and alexa to read that information for me. 我不知道是否有可能在我的手机中打开任何随机应用程序并从中获取信息以及alexa可以为我读取该信息。
For ex, is it possible to program alexa to open UBER in my cellphone and read to me how far is the driver ,How much is the fare etc ...? 例如,是否可以对alexa进行编程,以便在我的手机中打开UBER并向我朗读驾驶员,票价等等?

You cannot open/launch a mobile App from an Alexa skill. 您无法使用Alexa技能打开/启动移动应用程序。 The closest you could get would be triggering a push notification. 您所能获得的最接近的结果将是触发推送通知。

However, your sample use case is possible because Alexa can communicate with other APIs and this data is available through the Uber API. 但是,您的示例用例是可能的,因为Alexa可以与其他API通信,并且可以通过Uber API获得此数据。 See https://developer.uber.com/docs/v1-requests-current 参见https://developer.uber.com/docs/v1-requests-current

The user would need to perform the following steps to enable the feature (steps can be performed in either order): 用户将需要执行以下步骤来启用该功能(可以按照任何顺序执行这些步骤):

  • When logged into your website/app, the user links their Uber account with an OAuth login, which allows your website to access the Uber API. 登录到您的网站/应用程序后,用户会将其Uber帐户与OAuth登录信息关联,从而允许您的网站访问Uber API。 (Access tokens must be stored on your website NOT in your phone App) (访问令牌必须存储在您的网站上,而不是存储在手机应用程序中)
  • Enable your skill in the Alexa app/website and link to the user account on your website by logging into your website with OAuth. 通过使用OAuth登录您的网站,在Alexa应用程序/网站中启用您的技能,并链接到您网站上的用户帐户。

Unfortunately, two OAuth steps are almost certainly required in this case, one to link Alexa to your website, and another to link your website to Uber, as per https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/linking-an-alexa-user-with-a-user-in-your-system , noting this line: " Your service redirects the user to an Amazon-specific URL and passes along the state, access_token, and token_type in the URL fragment ." 不幸的是,在这种情况下,几乎肯定需要执行两个OAuth步骤,一个步骤是按照https://developer.amazon.com/public/solutions/alexa/alexa-将Alexa链接到您的网站,另一个将您的网站链接到Uber。 Skills-kit / docs / linking-alexa-user-with-a-user-in-your-system中的用户 ,请注意以下这一行:“ 您的服务会将用户重定向到特定于Amazon的URL,并传递状态access_token,和URL片段中的token_type 。” (In theory, Uber could setup their OAuth process to allow directly linking your skill to their account, but they would need to specifically support it.) (从理论上讲,Uber可以设置其OAuth流程以允许将您的技能直接与他们的帐户关联,但是他们需要专门支持它。)

Note that Uber has actually already enabled this type of functionality in their Uber Skill. 请注意,Uber实际上已经在其Uber Skill中启用了此类功能。 See https://devblog.uber.com/alexa-your-uber-is-arriving-now/ 参见https://devblog.uber.com/alexa-your-uber-is-arriving-now/

Your skill would need to be integrated with an application on your phone. 您的技能需要与手机上的应用程序集成。 For example, the skill could update a database on a server that the phone application periodically polls. 例如,该技能可以更新电话应用程序定期轮询的服务器上的数据库。

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

相关问题 亚马逊Alexa技能套件:如何与外部应用程序帐户/ userId链接 - Amazon Alexa Skills Kit: How do you link with external app account / userId 如何以编程方式将AWS lambda触发器设置为Alexa Skills - How to set a AWS lambda trigger to Alexa Skills programatically Amazon Alexa:该代码可用于内置技能吗? - Amazon Alexa: Is the code available for built in skills? alexa技能免费怎么赚钱,而亚马逊服务是收费的? - How do alexa skills earn money if they are free, but amazon services have a cost? 如何使用Flask-Ask,Amazon Alexa和Python 3后端创建对话技能 - How to create conversational skills using Flask-Ask, Amazon Alexa and Python 3 backend 如何输入亚马逊Alexa技能套件(ASK)混合字符串与数字? - How to give input to Amazon Alexa Skills Kit (ASK) mixed string with numbers? 亚马逊Alexa Skills Kit(ASK)能否检测到它被中断的位置(如果是)? - Can Amazon Alexa Skills Kit (ASK) detect where it was interrupted (if it was)? Alexa技能套件-自定义技能,可从我们的iOS应用的API播放音频 - Alexa Skills Kit - Custom Skill that Plays Audio from our iOS app's API 如何使用Amazon API提取信息 - How To Extract Information Using The Amazon API 具有Alexa技能的AVS - AVS with Alexa Skills
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM