我正在使用js sdk登录facebook。 我已经设置了所有权限并在函数调用时设置了所有字段,但我没有获得用户生日日期。
我正在使用权限参数数组用于范围和字段数组用于字段retrive
我使用以下代码: -
var permissions = [
'email',
'user_likes',
'friends_likes',
'user_about_me',
'friends_about_me',
'user_birthday',
'friends_birthday',
'user_education_history',
'friends_education_history',
'user_hometown',
'friends_hometown',
'user_relationships',
'friends_relationships',
'user_relationship_details',
'friends_relationship_details',
'user_location',
'friends_location',
'user_religion_politics',
'friends_religion_politics',
'user_website',
'friends_website',
'user_work_history',
'friends_work_history'
].join(',');
// Specify the user fields to query the OpenGraph for.
// Some values are dependent on the user granting certain permissions
var fields = [
'id',
'name',
'first_name',
'middle_name',
'last_name',
'gender',
'locale',
'languages',
'link',
'third_party_id',
'installed',
'timezone',
'updated_time',
'verified',
'age_range',
'bio',
'birthday',
'cover',
'currency',
'devices',
'education',
'email',
'hometown',
'interested_in',
'location',
'political',
'payment_pricepoints',
'favorite_athletes',
'favorite_teams',
'picture',
'quotes',
'relationship_status',
'religion',
'significant_other',
'video_upload_limits',
'website',
'work'
].join(',');
function login() {
FB.login(function(response) {
if(response != ''){
var r = response.authResponse;
var userID = r.userID;
getUserInfo();
}
}, {scope: permissions , return_scopes: true});
}
function getUserInfo() {
FB.api('/me', {fields: fields},
function(response) {
console.log("User details of data"+JSON.stringify(response));
});
}