Skip to main content
Contributor I
July 24, 2019
Question

Help subscribing to events with API

  • July 24, 2019
  • 1 reply
  • 545 views
Hello,

I'm in the process of building a Sonos iPhone app with Swift using the Sonos API but have hit a stumbling block. I would like to detect a state / volume / metadata change on my app when someone uses a different app or the hardware buttons. I believe that subscribing to events is the way forward. I have copied in the reference link below.

  • Subscribe—Subscribe to group namespaces to receive events when states change, such as changes to volume or playback status.

https://developer.sonos.com/build/direct-control/connect/

I send a HTTP POST to the subscription path as described and get a 200 ok response back but have no idea what to do next. I've been using Xcode and testing with Postman. The callback url is registered on the developer site and OAuth token is verified.

Any help would be greatly appreciated.

Thanks, Paul
    This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.

    1 reply

    jgatie
    July 24, 2019
    Hello,

    I'm in the process of building a Sonos iPhone app with Swift using the Sonos API but have hit a stumbling block. I would like to detect a state / volume / metadata change on my app when someone uses a different app or the hardware buttons. I believe that subscribing to events is the way forward. I have copied in the reference link below.

    • [url-custom=https://developer.sonos.com/build/direct-control/connect/] Subscribe[/url-custom]—Subscribe to group namespaces to receive events when states change, such as changes to volume or playback status.
    https://developer.sonos.com/build/direct-control/connect/

    I send a HTTP POST to the subscription path as described and get a 200 ok response back but have no idea what to do next. I've been using Xcode and testing with Postman. The callback url is registered on the developer site and OAuth token is verified.

    Any help would be greatly appreciated.

    Thanks, Paul


    This is probably not the audience to be asking these questions, though a couple developers do post on this forum.

    On the Sonos developers support page here:

    https://developer.sonos.com/support/

    developers are encouraged to use stackoverflow for support.