kaaes / spotify-web-api-android

A wrapper for Spotify Web API. It uses Retrofit to create Java interfaces from API endpoints
http://kaaes.github.io/spotify-web-api-android
MIT License
379 stars 139 forks source link

Error 401 "No token provided" when i try to use SpotifyService variable. #174

Closed willccoates closed 5 years ago

willccoates commented 5 years ago

Hello, i receive this error when i try to access SpotifyService in order to pull down information about the current users playlists.

Before i try to call the SpotifyService object variable i do a log print to ensure that i have my token and that it was assigned to my token variable, so the token does exist and i do pass it to api.setAccessToken(). I have included my code below.. Any help would be appreciated!

` private void startSpotifyService() { Log.d(TAG, "startSpotifyService");

    api.setAccessToken(token);

    SpotifyService spotify = api.getService();

    initSpotifyInfo(spotify);
}

private void initSpotifyInfo(SpotifyService spotify) {

    Log.d(TAG, "initSpotifyInfo");

    String usrName = spotify.getMe().display_name;

    Log.d(TAG, "Current user: " + usrName);

}`