其實只要在API request中加上
&locale=zh_TW即可得到中文姓名,如:me?fields=id,name&locale=zh_TW,只是有趣的是我稍微測了一下locale給以開頭en_以外的任何值都會取得中文名稱,還以為預設會以英文為主。
&locale=zh_TW即可得到中文姓名,如:me?fields=id,name&locale=zh_TW,只是有趣的是我稍微測了一下locale給以開頭en_以外的任何值都會取得中文名稱,還以為預設會以英文為主。
app.use(parseFacebookUserSession({
clientId: 'YOUR_FB_CLIENT_ID',
appSecret: 'YOUR_FB_APP_SECRET',
redirectUri: '/login',
scope: 'user_friends,user_likes', // 要求friends與like資訊
}));
{
"id": "104342733239984",
"name": "Hello world",
"friends": {
"data": [],
"summary": {
"total_count": 1
}
}
}
可以看到summary中,total_count為1,但data中無資料。{
"id": "1421116644879628",
"name": "Doraemon Cat",
"friends": {
"data": [
{
"name": "Open Graph Test User",
"id": "1414470195545509"
},
{
"name": "Monkey D Luffy",
"id": "100347703641647"
}
],
"paging": {
"next": "https://graph.facebook.com/1421116644879628/friends?limit=25&offset=25&__after_id=enc_AdAMpWdRxSLZAvND6bEd0htyyGsZAZBvzP6jzoAIZBKS9EiBSndZCNZC3S1AC5TEYchbuuBSV0xvg7ziwO4Cdt843yZApF"
},
"summary": {
"total_count": 2
}
}
}
可以看到此test user有兩個朋友也都有安裝此app。