Here's what I've tried so far: - (IBAction)getPlaylistsButtonTapped:(id)sender {
NSURLRequest *playlistrequest = [SPTPlaylistList createRequestForGettingPlaylistsForUser:@"charleshyowonkang" withAccessToken:_accessToken error:nil]; [[SPTRequest sharedHandler] performRequest:playlistrequest callback:^(NSError *error, NSURLResponse *response, NSData *data) {
if (error != nil) { NSLog(@"error");
}
SPTPlaylistList *playlists = [SPTPlaylistList playlistListFromData:data withResponse:response error:nil];
NSLog(@"Got possan's 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) {
NSLog(@"error2");
}
SPTPlaylistList *playlists2 = [SPTPlaylistList playlistListFromData:data2 withResponse:response2 error:nil];
NSLog(@"Got possan's playlists, second page: %@", playlists2);
}];}];
}
All the tutorials/stackoverflow posts I have googled are for web projects, but I am trying to do this in iOS.
I only really need to make a request to the API twice.
1) when a user logs in with their spotify account
2) when a user presses the "sounds" button and it pulls their playlists/tracks.
Any iOS help would be very helpful.
I am using the below for getting the albums and trying to pick up one song from the playlist. It is working fine.
Please let me know if you need any more details.