简体   繁体   中英

Spotify SDK iOS SDK 403 error

New to iOS and programming in general. I'm working with Spotify SDK (beta) to try and make a client to stream tracks that I've saved.

When calling their savedTracksForUserInSession method, which I was told to do by their developers, I keep getting a 403 error: Forbidden. My session is good, so is another method that is used to play their tracks/album/artists...

Any help would be much appreciated!

-(void)fetchSavedTrack:(SPTSession*) session {

[SPTRequest savedTracksForUserInSession:session callback:^(NSError *error, SPTListPage* trackList) {
    if (error != nil) {
        NSLog(@"%@", error);
        return;
    }

    NSLog(@"This block is being run");

    self.savedTracks = [[NSArray alloc]initWithArray:trackList.items];
    NSLog(@"%@", self.savedTracks);
}];
}

SOLUTION: Had to add SPTAuthUserLibraryReadScope scope for authorization. Thanks, Armin for pointing it out to me.

You probably have to add the proper "Scope" to be able to get access to read the user's saved tracks. You probably need the user-library-read scope.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM