Facebook登录并访问用户信息钛

时间:2014-07-07 07:11:43

标签: facebook-graph-api titanium facebook-login

我有一个钛金属应用程序,我希望Facebook登录并访问用户信息,如电子邮件,名字,姓氏,DOB到fb登录..我怎么能这样做?

1 个答案:

答案 0 :(得分:0)

此方法可以帮助您获取数据。从Facebook登录后使用此功能

function getFacebookInfo(){
    Titanium.Facebook.requestWithGraphPath('me', {}, 'GET', function(e){
        if (e.success){
            var jsonObject  = JSON.parse(e.result);
            //do something here with these values. They cannot be passed out of this
            //function call... this is an asynchronous call
            //that is, do this:
            saveToDb(jsonObject.first_name);
        } else {
            //some sort of error message here i guess
        }
    });

};

由于