0

In my app based on spotify, I don't want to load user specific playlist, instead I want every user to enjoy playlist, which I have created in my account. how can I achieve this.

Below is the short summary regarding my query.

I've developed app which is enabled with spotify. You can go through my app at Workout DJ PRO for Spotify . Once you go through this app, you will find some playlist and tracks in it. I have integrated those using my Spotify account.

Now I'm coming back to original problem..

When I do login into my app using my Spotify account, in which I've created playlist & tracks, I am able to enjoy app with very well functionalities. But if I try to login through another credential. I'm not able to load either of those playlists or tracks.

Another query raised from this explanation is:

  1. Does Spotify supports universal playlist facility? Answer : IF Yes --> kindly guide me how to achieve this IF No --> Is there anything unique along with my username? So that I can access my playlist in another account?

Any help will be appreciated..!

Niru Mukund Shah
  • 4,637
  • 2
  • 20
  • 34

1 Answers1

1

You need the URL of the playlist you need in your app.

Then, once you're logged in as the other user:

NSURL *url = [NSURL URLWithString:@"<your playlist URL>"];

[[SPSession sharedSession] playlistForURL:url callback:^(SPPlaylist *playlist) {
    NSLog(@"Got playlist!");
}];

IMPORTANT: You must make sure the playlist(s) you need accessible by other users are set as "Published" in the Spotify desktop client.

iKenndac
  • 18,730
  • 3
  • 35
  • 51
  • Though I have set my playlist as "Published", I'm not able to see my playlist when I login through another user. – Niru Mukund Shah Dec 31 '12 at 05:34
  • That's correct. You need to manually reference it by URL, like my answer details. – iKenndac Dec 31 '12 at 10:37
  • I can't do that Danial. I can play tracks using their specific urls.I want to show my playlist into another Spotify account!! – Niru Mukund Shah Dec 31 '12 at 10:42
  • Yes, and to get it, you need to reference it by URL. Once you have it, you can then display it to the user as you would any other playlist, or add it to their playlist container to subscribe them to it, etc. – iKenndac Dec 31 '12 at 10:51
  • playlistForURL doesn't work daniel. I have url with me. but this function doesn't work – Niru Mukund Shah Jan 02 '13 at 05:09
  • it does work, if I'm logged in with my account, but is not working for another user – Niru Mukund Shah Jan 02 '13 at 05:17
  • thanks daniel, I got the playlist. The problem was the SPPlaylist didn't get load. So I fetch playlist after [SPAsyncLoading waitUntilLoaded:playlist timeout:kSPAsyncLoadingDefaultTimeout then:^(NSArray *loadedPlaylists, NSArray *notLoadedPlaylists) this method call. – Niru Mukund Shah Jan 02 '13 at 05:59