我正在嘗試創建一個Spotify應用程序,但是當進行登錄時,我收到一條奇怪的錯誤消息: * 19:28:57.916我[offline_authorizer.cpp:289]無法登錄離線:沒有這樣的用戶無法登錄離線:沒有這樣的用戶 - Spotify
int main() {
sp_session *sp;
sp_error err;
sp_session_callbacks callbacks;
callbacks.logged_in = &logged_in;
callbacks.notify_main_thread = ¬ify_main_thread;
callbacks.music_delivery = &music_delivery;
callbacks.metadata_updated = &metadata_updated;
callbacks.play_token_lost = &play_token_lost;
callbacks.log_message = &log_message;
callbacks.end_of_track = &end_of_track;
sp_session_config config;
config.api_version = 10;
config.cache_location = "/tmp/libSpotify";
config.settings_location = "/tmp/libSpotify1";
config.application_key = g_appkey;
config.application_key_size = g_appkey_size;
config.user_agent = "Name_of_client";
config.callbacks = &callbacks;
config.tracefile = "/tmp/trace";
err = sp_session_create(&config, &sp);
g_sess = sp;
if (SP_ERROR_OK != err) {
fprintf(stderr, "Unable to create session: %s\n",
sp_error_message(err));
exit(1);
}
sp_session_login(sp, username, password, 0);
printf("Exiting");
return 0;
}
我已經使用了點唱機的例子,但似乎無法得到它的工作。我可以登錄到我的帳戶並使用該帳戶在計算機上播放音樂。
您是否在使用Spotify高級帳戶使用此功能? – lunixbochs 2012-02-15 19:37:25
是的,我使用溢價。但我真的不明白爲什麼它會說脫機登錄... – Hiny 2012-02-15 19:38:59