2

我在 iphone 中使用 fbcoonect 连接 facebook。当我第一次登录时,它会提供数据,但在注销 facebook 并使用另一个帐户登录后,也会提供与上次给定的数据相同的数据。我的代码在这里像 -

- (void)session:(FBSession*)session didLogin:(FBUID)uid {
self.usersession =session;


NSString* fql = [NSString stringWithFormat:
                 @"select     uid,name,first_name,middle_name,last_name,birthday,email,pic_square from user where uid == %lld",self.usersession.uid];


[NSDictionary dictionaryWithObject:fql
                            forKey:@"query"];
[[FBRequest requestWithDelegate:self]
 call:@"facebook.fql.query" params:params];
NSLog(@"User with id %lld logged in.", uid);
self.post=NO;}

我也尝试这样的代码 -

 - (void)session:(FBSession*)session didLogin:(FBUID)uid {
self.usersession =session;
NSLog(@"User with id %lld logged in.", uid);
[self getFacebookName];}

- (void)getFacebookName {
NSString* fql = [NSString stringWithFormat:
                 @"select uid,name,first_name,middle_name,last_name,birthday,email,pic_square from user where uid == %lld",self.usersession.uid];


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

但它有同样的错误。请给出解决方案。

4

0 回答 0