Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use voice input for mirror-api cards?

I'd like to use the voice input on a mirror-api app I am developing, similar to what happens when you select the built in menu action "reply". This is in use in the app "Kitchme" to search for recipes with their custom menu action "Search for". I believe it uses the built in voice input to collect a string to search.

Is this possible, and if so how? Thanks!

like image 909
jbyeung Avatar asked Oct 03 '22 13:10

jbyeung


1 Answers

What "Kitchme" uses isn't a custom menu item, but actually the default REPLY menu item with custom values for display. When defining your timeline card you can overwrite the default display name and icon to match whatever you want to use the reply functionality for.

{
  "text": "Hello world",
  "menuItems": [
    {
      "action": "REPLY",
      "values": [{
        "displayName": "Search",
        "iconUrl": "http://example.com/icons/search.png"
      }]
    }
  ]
}

You can handle those the same way you would handle other reply actions via subscriptions, see https://developers.google.com/glass/subscriptions#reply

like image 152
Scarygami Avatar answered Oct 07 '22 19:10

Scarygami