Spotify get all user playlists

In spotify iOS SDK, getting the playlist code has an offset = 0, and limit = 20

But if the user has 21 or more playlists.

So how can I contact them? Any idea?

Im using

[SPTPlaylistList playlistsForUser:
                  withAccessToken:
                         callback:];
+4
source share
1 answer

I found my answer to the Api Reference definition

// Get the first two pages of playlists for the user

NSURLRequest*playlistrequest = [SPTPlaylistList createRequestForGettingPlaylistsForUser:@"possan" withAccessToken:accessToken error:nil]; [[SPTRequest sharedHandler] performRequest:playlistrequest callback:^(NSError *error, NSURLResponse *response, NSData *data) {
if (error != nil) { Handle error }
SPTPlaylistList *playlists = [SPTPlaylistList playlistListFromData:data withResponse:response error:nil];
NSLog(@"Got possan playlists, first page: %@", playlists);
NSURLRequest *playlistrequest2 = [playlists createRequestForNextPageWithAccessToken:accessToken error:nil];
[[SPTRequest sharedHandler] performRequest:playlistrequest2 callback:^(NSError *error2, NSURLResponse *response2, NSData *data2) {
    if (error2 != nil) { Handle error }
    SPTPlaylistList *playlists2 = [SPTPlaylistList playlistListFromData:data2 withResponse:response2 error:nil];
    NSLog(@"Got possan playlists, second page: %@", playlists2);
}];}];
+5
source

All Articles