iosswiftspotifyplaylists

Spotify Playlist ios sdk swift issues


For some reason whenever I run the function get Spotify playlists, it returns that I have no playlists even though I have two. I was wondering what the issue was. Thanks, Richard

        SPTPlaylistList.playlists(forUser: auth?.clientID,     withAccessToken: auth!.session.accessToken , callback: {
        (error, results)->Void in
        if (error != nil) {
            print(error!)
        } else {
            let hisplaylists = results as! SPTListPage
            print(hisplaylists)
        }
    })
}

Solution

  • You need to use auth?.session.canonicalUsername instead of auth?.clientID