Announcements

Open Spotify URI on iOS app without autoplaying or affecting playback

Reply
Highlighted

Open Spotify URI on iOS app without autoplaying or affecting playback

Regular

I am using the following Swift code to open a Spotify URI on iOS, which always autoplays the track:

 

let spotifyURI = "spotify:track:<some track uri>"

if let url = URL(string: spotifyURI) {

    UIApplication.shared.open(url)

}

 

Is there a way to open Spotify without affecting the current playback state in any way? I would like to allow my app's users to jump to track information in the Spotify app without ruining what track is currently playing. I've tried using the open.spotify.com/... URL type but that leads to the same issue.

SUGGESTED POSTS