0
我的FB.login(它應該具有的功能範圍結束:FBJS朋友生日的OAuth 2.0
}, {scope:'user_birthday,friends_birthday'});
在功能permissionsTest用戶登錄後()火災:
function permissionsTest(){
FB.api('me/friends?fields=birthday', {fields:'birthday'}, function(response) {
alert(response.data[1]);
});
}
但是,所有的警報的回報是:[對象的對象]當我想看到的東西,如:1983年12月9日
如何把這個工作
?看到: graph.facebook.com/me/friends?fields=birthday
你可以清楚地看到,有一個名爲「數據」持有對象的數組叫做「ID」和「生日」
對象我的先前的嘗試:
response.data [1]返回[對象的對象]
響應返回[對象的對象]
response.data [1] .ID返回未定義
response.data [1] .birthday返回undefined
response.id return s undefined
response.birthday returns undefined
我看起來似乎沒有把握,我覺得我已經用盡了文檔,堆棧和谷歌。
我忘了提,[1]我與response.data努力的原因是因爲第一個朋友「我的」ID的朋友的生日是空的。 –
剛剛測試過!你的明星! –