2013-02-16 109 views
0

我希望能夠從Spotify(可樂焦點允許)連接到我的Facebook應用程序。在預覽API中缺少驗證碼

然而,預覽API(我需要爲我的應用程序),它看起來像authenticateWithFacebook丟失:

http://developer.spotify.com/technologies/apps/docs/09321954e7.html

最接近的是:

https://developer.spotify.com/technologies/apps/docs/preview/api/api-facebook-facebooksession.html

在那裏你可以使用showConnectUI,但看起來不起作用,並且沒有記錄。

+0

嗨,我想同樣的問題,請幫助我,如果你找到任何解決方案 – 2013-05-31 15:01:58

回答

0

auth模塊一開始並不在場,但現在它已成爲Spotify應用程序API的一部分。你可以在its documentation page上閱讀更多關於它的信息。它看起來像這樣:

require(['$api/auth#Auth'], function(Auth) { 
    var appId = '<your_app_id>', 
     permissions = ['user_about_me']; 

    var auth = new Auth(); 
    auth.authenticateWithFacebook(appId, permissions) 
     .done(function(params) { 
     if (params.accessToken) { 
      console.log('Your access token: ' + params.accessToken); 
     } else { 
      console.log('No access token returned'); 
     } 
     }).fail(function(req, error) { 
      console.error('The Auth request failed with error: ' + error); 
     }); 
    } 
    }); 

此外,在Tutorial App on GitHuba working example