4

The "Add a cat to that" example explains how to share a photo with my service.

But is there a way to share a photo with a text (using voice recorder) in a single item ?

Marc Lebel
  • 61
  • 2

1 Answers1

3

Yup! You can do this using the REPLY built-in menu item.

However, the flow is a bit different than the Add a Cat to That flow. It works like this:

  1. Subscribe to updates to the timeline collection.
  2. Insert a timeline item with the REPLY built in action specified as shown here. Optionally, you can rename the menu item and customize the icon.

    {
      "text": "Hello world",
      "menuItems": [
        {
          "action": "REPLY"
        }
      ]
    }
    
  3. The timeline card will have a reply option in its menu. When the user selects it, they will be prompted to speak.

  4. A new timeline card is then created which contains the text transcription and has an attached audio recording. Your Glassware has access to this card.
  5. Your Glassware is then notified about this item insertion. The notification looks something like this:

    {
      "collection": "timeline",
      "itemId": "3hidvm0xez6r8_dacdb3103b8b604_h8rpllg",
      "operation": "INSERT",
      "userToken": "harold_penguin",
      "verifyToken": "random_hash_to_verify_referer",
      "userActions": [
        {
          "type": "REPLY"
        }
      ]
    }
    
  6. Fetch the indicated timeline item to access the transcribed text (in the text property) and the attached audio recording
mimming
  • 13,974
  • 3
  • 45
  • 74
  • Just to see if I understand this, Jenny, the full flow would be like: 1.1 the user shares a photo a la "add a cat to that", 2 the service inserts the timeline card (perhaps with the photo in it) for the user to annotate – jeffrey_t_b Apr 19 '13 at 23:37
  • I understand your question better. Yup! That's pretty much it. You can also update the timeline card for the shared photo if you like. You can add the `reply` menu item. This allows users to reply to that card. – mimming Apr 19 '13 at 23:54
  • Thank you so much for this quick answer ! – Marc Lebel Apr 20 '13 at 13:37