Search code examples
google-glassgoogle-mirror-api

Mirror API: Go to existing card


I want to be able to create a custom action, that will lead to another card in my Glassware. For example, custom action for my shopping list app that will look like that:

  "menuItems": [
{
  "action": "CUSTOM",
  "values": [
    {
      "displayName": "Start Shopping",
      "iconUrl": "http://i.imgur.com/RiO9mCR.png"
    }
  ]
}],

And when the user presses the Start Shopping button, it will lead him to another card in my timeline.

How can I do that?


Solution

  • You can't do exactly what you are trying to do. Glass isn't really intended to be navigated like this, and I'm not sure that this would be a very good user experience if it was implemented. If you feel this is an important feature, you can request it, providing as many use cases as you can.

    Depending on your needs, you may not need to do this, however. When your custom action is triggered on the server, it can do something like update the card you want them to visit, giving it the latest timestamp, and sending a notification. This will either bump it up in the timeline or refresh it on the pinned cards. Give this a try and see if it will meet your needs.