How do I add the "View Website" action to a timeline card?
Asked Answered
I

1

6

As of firmware update XE7, Glass adds a "View Website" action to search results. How do I add this action to my own timeline cards, such that it will open the Glass Browser with an arbitrary URL?

Insalivate answered 2/7, 2013 at 17:15 Comment(0)
J
5

Add the OPEN_URI built-in menu item to your timeline item and the URL to menuItem.payload. The JSON for a timeline item might look like this:

{ 
  "text" : "Hello World!",
  "menuItems" : [{
    "action" : "OPEN_URI",
    "payload" : "http://example.com"
  }]
}

You can read more about built-in menu items on the official documentation for this feature.

Jog answered 2/7, 2013 at 17:22 Comment(2)
Thanks, Jenny. Issue 137: Make "View Website" a built-in menu actionInsalivate
Well, it's documented as part of developers.google.com/glass/v1/reference/timeline/insert under menuItems[].action = VIEW_WEBSITE so does XE7 not support handling those?Dispersion

© 2022 - 2024 — McMap. All rights reserved.