OpenHome Forum
ohLibspotify not calling any callback after login - Printable Version

+- OpenHome Forum (http://forum.openhome.org)
+-- Forum: OpenHome (/forumdisplay.php?fid=1)
+--- Forum: LibSpotify (/forumdisplay.php?fid=6)
+--- Thread: ohLibspotify not calling any callback after login (/showthread.php?tid=1355)



ohLibspotify not calling any callback after login - feanaro100 - 22-02-2015 09:37 PM

I'm trying to create a project where I use the ohLibspotify .Net libspotify wrapper to login to spotify and stream playlists.

As far as I can see I've set everything up the same way like in the example. First create a session like so:

Code:
SpotifySessionConfig sp_config = new SpotifySessionConfig()
        {
            ApiVersion = 12,
            CacheLocation = "cache",
            SettingsLocation = "settings",
            UserAgent = "player",
            ApplicationKey = Properties.Resources.appkey,
            Listener = new sp_Listener()
        };
sp_session = SpotifySession.Create(sp_config);

Then I call relogin() if that fails than I show the login window to the user because no stored credentials have been found. When the user has supplied me with his account details I call login(username, password, true, null). After that I'm awaiting a call back to the sp_Listener class.

In the sp_Listener class I have overridden the following functions:

Code:
SpotifySessionListener.LoggedIn(SpotifySession session, SpotifyError error)
SpotifySessionListener.ConnectionError(SpotifySession session, SpotifyError error)
SpotifySessionListener.LogMessage(SpotifySession session, string data)

The only callback that gets called is the LogMessage callback. I've hooked it up to log4net to read all the output efficiently. This is all of the LogMessage output:

Code:
2015-02-22 20:58:38,636 [18] DEBUG Namespace.sp_Listener - 19:58:38.634 I [c:/Users/spotify-buildagent/BuildAgent/work/1e0ce8a77adfb2dc/client/core/session/offline_authorizer.cpp:297] Unable to login offline: no such user

2015-02-22 20:58:38,649 [18] DEBUG Namespace.sp_Listener - 19:58:38.649 I [c:/Users/spotify-buildagent/BuildAgent/work/1e0ce8a77adfb2dc/client/core/session/offline_authorizer.cpp:297] Unable to login offline: no such user

2015-02-22 20:58:38,651 [14] DEBUG Namespace.sp_Listener - 19:58:38.649 E [c:/Users/spotify-buildagent/BuildAgent/work/1e0ce8a77adfb2dc/client/core/network/proxy_resolver_win32.cpp:215] WinHttpGetProxyForUrl failed

2015-02-22 20:58:38,664 [19] DEBUG Namespace.sp_Listener - 19:58:38.661 I [ap:1752] Connecting to AP ap.gslb.spotify.com:4070

2015-02-22 20:58:38,713 [19] DEBUG Namespace.sp_Listener - 19:58:38.713 I [ap:1226] Connected to AP: 193.182.7.34:4070

It seems like I must have forgotten something. I've no idea what, maybe one of you guys knows a solution.


RE: ohLibspotify not calling any callback after login - andreww - 23-02-2015 02:04 PM

I believe you've seen it already, but in case anyone else has the same problem, I've answered your question on Stack Overflow: http://stackoverflow.com/a/28675506/2283


RE: ohLibspotify not calling any callback after login - feanaro100 - 23-02-2015 09:53 PM

Thanks again for your quick response to my question!