且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何通过 Facebook API 获取生日?

更新时间:2023-12-02 17:07:04

由于您没有发布登录代码,也没有提及权限,我想您忘记了一件重要的事情:使用 user_birthday进行授权> 许可.

Since you did not post your login code and you did not mention permissions, i assume you forgot one important thing: Authorizing with the user_birthday permission.

FB.login(function(response) {
    if (response.authResponse) {
        //user authorized the app
    }
}, {scope: 'user_birthday', return_scopes: true});

user_birthday 是权限,birthday 是字段的名称.如果它仍然不起作用,那么很可能没有设置生日.不确定是否需要.

user_birthday is the permission, birthday is the name of the field. If it still doesn´t work, then there is most likely no birthday set. Not sure if it is required.

例如:http://www.devils-heaven.com/facebook-javascript-sdk-登录/