Announcements

Help Wizard

Step 1

NEXT STEP

How to play "liked songs" playlist using Spotify Android SDK

How to play "liked songs" playlist using Spotify Android SDK

I can see that the only way to play song is using `PlayerApi`'s play method that accepts a `URI` of either song, album or playlist. My use case is to show the user with the list of their liked songs and play any of those songs that should continue with any song that is after that. So, instead of passing the selected song `URI`, I probably should pass the liked songs playlist URI and then call `skipToIndex` using the same URI and the selected song position.

 

However, I cannot find how I can get user's liked songs playlist URI anywhere. Is it possible? If not, is there any other way to achieve the same functionality?

 

Reply
6 Replies

I don't know how it's called in or works with the SDK, but this is the Web API documentation of the endpoint you are looking for: https://developer.spotify.com/documentation/web-api/reference/get-users-saved-tracks

Has anyone been able to actually get saved tracks successfully? 

 

I get Forbidden 403 error, even with updated access token. Other endpoints work for me.

Hi jsmnkk, that endpoint wil not work with Client Credentials, and you need to use the user-library-read Authorization scope with the Authorization code flow.

It's not what I'm looking for. I already use it for fetching the list of tracks, but there is no playlist URI in there.

It has no Playlist URI. That is the only way.

How do I make Spotify play the next track in the playlist instead of random songs? Also, the shuffle and repeat modes functionality doesn't work since the song URI is passed and not the playlist URI.

Suggested posts