You can add a URL link to the Info View 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.

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 i18next file that is to display in the Info View of the Sonos app. For this example, we use "Concerts".

            "CONCERTS_STRING": "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.

       <getExtendedMetadata xmlns="http://www.sonos.com/Services/1.1">  
  3. 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.

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.sonos.com/Services/1.1">
                   <title>This is the title</title>
                      <artist>Example Artist</artist>
                       . . . Details of the action for favorites "Save to My Acme Music" in the Info View are not shown . . .
                . . . Details for other custom actions in the Info View are not shown . . .
  4. 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:

    idA unique ID for this action.
    titleThe value CONCERTS_STRING corresponds to the key-value pair in the i18next file above.
    actionTypeThis value for an Open URL action must be openUrl.
    openUrlActionThis 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.
  5. When a listener chooses an openUrl action, the Sonos app opens the provided URL.

See SMAPI Object Types for details.