Reputation: 1
I'm using the iOS SDK provided by SoundCloud. My issue is the following : i can't get my playlists. Indeed, there a few weeks, everything was working properly but now my jsonResponse object is nil. Here is an excerpt of my code :
//Get soundcloud account to launch request
SCAccount *account = [SCSoundCloud account];
SCRequestResponseHandler handler;
handler = ^(NSURLResponse *response, NSData *data, NSError *error) {
NSError *jsonError = nil;
NSJSONSerialization *jsonResponse = [NSJSONSerialization
JSONObjectWithData:data
options:0
error:&jsonError];
if (!jsonError && [jsonResponse isKindOfClass:[NSArray class]]) {
//response treatment
}
NSString *resourceURL = @"https://api.soundcloud.com/me/playlists.json";
[SCRequest performMethod:SCRequestMethodGET
onResource:[NSURL URLWithString:resourceURL]
usingParameters:nil
withAccount:account
sendingProgressHandler:nil
responseHandler:handler];
I don't understand because the two following requests return results:
NSString *resourceURL = @"https://api.soundcloud.com/me.json";
Request with this URL return an NSDictionary which contains some informations such as the number of playlists (return 61 playlists)
NSString *resourceURL = @"https://api.soundcloud.com/me/tracks.json"; Request with this URL return an NSArray which contains some informations about my tracks
So, i am wondering if the url to get all playlists of my account with soundcloud api would not have changed ? Thank you in advance for your answers.
Upvotes: 0
Views: 561
Reputation: 185
Since SoundCloud decided not to maintain anymore this library I created my own one, maybe it could helps you. One of the request I've already implemented is request your playlists:
[self.soundCloudPort requestPlaylistsWithSuccess:^(NSArray *playLists) {
// Here you have your playlists
} failure:^(NSError *error) {
// Handle the error
}];
Upvotes: 1