简体   繁体   English

如何在iPhone SDK中从Facebook访问我的个人资料信息?

[英]How to access my profile info from facebook in iphone sdk?

How can i fetch my profile information from facebook, using facebook api for iphone sdk. 我如何使用iPhone iPhone SDK的Facebook API从Facebook获取我的个人资料信息。 I have successfully able to login using connect method. 我已经能够成功使用connect方法登录。

after that i have written query something like : 之后,我写了类似的查询:

- (void)session:(FBSession*)session didLogin:(FBUID)uid {
    NSString* fql = [NSString stringWithFormat:@"select uid,name,first_name,middle_name,last_name,affiliations,profile_update_time,timezone,religion,birthday,birthday_date,sex,hometown_location,relationship_status,political,current_location,activities,interests,music,tv,movies,books,quotes,about_me,hs_info,education_history,work_history,status,online_presence,family,username,website,is_blocked,contact_email,email,pic_small,pic_big,pic_square,pic,proxied_email,allowed_restrictions,verified from user where uid == %lld", _session.uid];

    NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];
    [[FBRequest requestWithDelegate:self] call:@"facebook.fql.query" params:params];
}

- (void)request:(FBRequest*)request didLoad:(id)result {

    if ([request.method isEqualToString:@"facebook.fql.query"]) {
        NSArray* users = result;
        NSDictionary* user = [users objectAtIndex:0];
        }
}

when i displayed user(Dictionary) i am not able to get all values from my profile. 当我显示user(Dictionary)时,我无法从个人资料中获取所有值。 some values which are already exists and set in my profile have been showing as null. 我的个人资料中已经存在并设置的一些值显示为null。

Why i am not able to get all info from my own profile ? 为什么我无法从自己的个人资料中获取所有信息? or How can i ? 或我该怎么办?

Any idea or help will be well appreciated ? 任何想法或帮助将不胜感激?

Please see this question, question updated with full implementation details: 请查看此问题,该问题已更新为完整的实施细节:

Can't get email address using facebook sdk for IOS and graph api for facebook 无法使用iOS的facebook sdk和facebook的graph api获取电子邮件地址

不,您不能>您可以使用Facebook API做一些事情,但不是全部

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM