Web page

You can add to the Info View a URL Link using the open URL action. The open URL action provides listeners with a URL to open a Web page or a mobile app for iOS and Android platforms. For example, you might provide a URL to show an artist’s concert schedule and perhaps a way to buy tickets. The URL must use secure HTTPS, “https://”. The following figure shows an example of an open URL action.

open URL

When the listener selects the open URL action, Sonos opens the URL in a browser or into an iOS or Android app. The URL you provide can link into your iOS or Android apps, or other third party apps. For more details on constructing app URLs, see the following relevant links:

The following steps describe how to implement the open URL action:

  1. Define the text string in your strings.xml file that is to display in the Info View of the Sonos app. For this example we use, “Concerts”.
  2. 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 actions for the Info View in your getExtendedMetadata response. To simplify this example we’ll show only the open URL action.

  1. The relatedActions element contains an action sub-element to provide a URL to open from the Info View. The relatedActions element can contain multiple action sub-elements, each representing a different custom action. The action sub-elements include the following:
    Element Description
    id A unique ID for this action.
    title The value CONCERTS_STRING corresponds to this stringId value in the strings.xml file above.
    actionType This value for an open URL action must be openUrl.
    openUrlAction This contains a single <url> sub-element whose value is the URL the listener opens.
    showInBrowse (Optional) By default, the action displays when the user is in either the browse or now-playing mode. To restrict the display of this action to only the now-playing mode, set this value to false.
  2. When a listener chooses an openUrl action, the Sonos app opens the provided URL.

See SMAPI Object Types for details.