2014-09-05 78 views
0

在流星的應用程序,當日志與本地主機上的Facebook,我獲得了user.services.facebook這些字段:流星,Facebook登錄,返回不同的值:那麼個人資料圖片呢?

{ 
    accessToken: 'long_acces_tkoen_string', 
    expiresAt: --, 
    id: '--', 
    email: '--', 
    name: '--', 
    first_name: '--', 
    last_name: '--', 
    link: 'https://www.facebook.com/--', 
    username: '--', 
    gender: '--', 
    locale: '--' 
} 

當我部署在https://modulus.io/我的應用程序,這些字段返回:

{ 
    accessToken: '--', 
    expiresAt: --, 
    id: '--', 
    email: '--', 
    name: '--', 
    first_name: '--', 
    last_name: '--', 
    link: 'https://www.facebook.com/app_scoped_user_id/--/', 
    gender: '--', 
    locale: '--' 
} 

沒有userneame,所以,我沒有像以前那樣構建的個人資料圖片:'https://graph.facebook.com/' + user.services.facebook.username + '/picture?width=100&height=100'

我該如何重建它?

我明白,這可能是由這個原因引起:https://developers.facebook.com/docs/apps/changelog#v2_0_graph_api

但我不明白爲什麼(爲什麼它會在本地主機上運行,​​而不是在模數)

+0

'用戶名'在API v2中不再可用。你是否使用相同的應用程序ID和相同的用戶來測試它? – CBroe 2014-09-06 14:55:18

+0

我用於本地開發的應用程序已經安裝很久以前;和我用來刺激我的品牌。我認爲老版本在AP v1上,而新版本在API v2上。但我怎麼知道?我如何遷移?我不確定要理解這一點:https://developers.facebook.com/docs/apps/upgrading – fabien 2014-09-06 20:37:57

回答

0

嗯,其實,你可以簡單地使用id字段。我從未注意到這一點。

但用戶有一個新的ID。例如,對於我而言,這些網址正在工作:

// old id field : 
https://graph.facebook.com/558820281/picture?width=200&height=200 

// old username field : 
https://graph.facebook.com/huet.fabien/picture?width=200&height=200 

// new id field 
https://graph.facebook.com/10154176840535282/picture?width=200&height=200 
相關問題