简体   繁体   English

在SmartPhone上从Google助手打开自定义应用

[英]open custom app from google assistant on smartPhone

Here's the problem, i'm developing an google assistant app where i should show a list to the user and when he press on item from the list i should open another app. 这是问题所在,我正在开发一个Google Assistant应用,我应该在其中向用户显示一个列表,当他按列表中的项目时,我应该打开另一个应用。 i was able to create list using the following :- 我能够使用以下方法创建列表:-

app.askWithList(app.buildRichResponse()
      .addSimpleResponse('Alright')
      .addSuggestions(
        ['Basic Card', 'List', 'Carousel', 'Suggestions']),
      app.buildList('Things to learn about')
      .addItems(app.buildOptionItem('MATH_AND_PRIME', ['math', 'math and prime', 'prime numbers', 'prime'])
        .setTitle('Math & prime numbers')
        .setDescription('42 is an abundant number because the sum of its ' +
          'proper divisors 54 is greater…')
        .setImage('http://example.com/math_and_prime.jpg', 'Math & prime numbers'))
      .addItems(app.buildOptionItem('EGYPT', ['religion', 'egpyt', 'ancient egyptian'])
        .setTitle('Ancient Egyptian religion')
        .setDescription('42 gods who ruled on the fate of the dead in the ' +
          'afterworld. Throughout the under…')
        .setImage('http://example.com/egypt', 'Egypt')
      )
      .addItems(app.buildOptionItem('RECIPES', ['recipes', 'recipe', '42 recipes'])
        .setTitle('42 recipes with 42 ingredients')
        .setDescription('Here\'s a beautifully simple recipe that\'s full ' +
          'of flavor! All you need is some ginger and…')
        .setImage('http://example.com/recipe', 'Recipe')
      )
    );

do any one have an idea how to do it? 有没有人知道如何做?

Google Assistant doesn't support push messages, so you need to send a push message using Fcm/Gcm from your fulfillment when the user select something. Google助理不支持推送消息,因此,当用户选择某些内容时,您需要从履行中使用Fcm / Gcm发送推送消息。 It means you need to implement push messages in your app, you need account linking and an oauth2 server. 这意味着您需要在应用程序中实现推送消息,需要帐户链接和oauth2服务器。 A lot of work at least at the moment. 至少目前很多工作。

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

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