Related text

To add your own action to the Info View that displays text, use the relatedText element in your getExtendedMetadata response. Also use your strings.xml file to define the text string shown in the Info View of the Sonos app. The following figure shows an example of a related text action.

Related text

The following steps describe how to implement the related text action:

  1. Here’s an example of the string in the en-US strings.xml file for the example above:

  1. When the listener selects the ellipsis (…) to see the Info View, Sonos sends your service a getExtendedMetadata request. This example is for a track item.

  1. Include all the custom action items for the Info View in your getExtendedMetadata response. To simplify this example we’ll show the related text custom action.

  1. The type value in the relatedText element corresponds to a stringId of the same ID in your strings.xml file. This string is what displays in the Info View of the Sonos app.
  2. When a user chooses a related text action, the Sonos app sends a getExtendedMetadataText request to your service using the given id and type.

  1. Your service should return the getExtendedMetadataText response containing the text to display. For example, when a user chooses About the Artist, your service would return a text description of that artist.