0

Having a little trouble with determining which custom menu item was selected in Python.

If I have the menu below, and have retrieved the card(html = item["html"]) in the notification processing code, how do I actually access the id value("verify")?

  "menuItems": [      
      { "action": "CUSTOM",
        "id":"verify",
        "values":
        [
          {
            "displayName": "Verify Incident",
            "iconUrl": "https"
          }
        ]
      }
  ]
user3136977
  • 361
  • 2
  • 6

1 Answers1

2

The notifications you get for your custom menuItem should look like this:

{
  "collection": "timeline",
  "itemId": "{long_id}",
  "operation": "UPDATE",
  "userToken": "{userToken}",
  "userActions": [
    {
      "type": "CUSTOM",
      "payload": "verify"
    }
  ]
}

The payload returns the ID which you specified for the menuItem.

Also see these links: https://developers.google.com/glass/develop/mirror/subscriptions#custom_menu_item_selected https://developers.google.com/glass/develop/mirror/menu-items#defining_custom_menu_items

Scarygami
  • 15,009
  • 2
  • 35
  • 24