我想弄清楚这个错误的含义是什么...iPhone Facebook SDK错误
我想通过Facebook SDK获取用户信息。所有我需要的是他们的电子邮件和姓名
Error Domain=facebookErrDomain Code=10000 "The operation couldn’t be completed. (facebookErrDomain error 10000.)" UserInfo=0xde94ad0 {error=<CFBasicHash 0xde7d100 [0x3f616650]>{type = mutable dict, count = 3,
entries =>
2 : <CFString 0xde722a0 [0x3f616650]>{contents = "type"} = <CFString 0xdeba1a0 [0x3f616650]>{contents = "OAuthException"}
3 : <CFString 0xde6ba20 [0x3f616650]>{contents = "message"} = <CFString 0xdeb12a0 [0x3f616650]>{contents = "An active access token must be used to query information about the current user."}
6 : <CFString 0xde74c40 [0x3f616650]>{contents = "code"} = 2500
}
}
我(在我的viewDidLoad以下)基本代码...
facebook = [[Facebook alloc] initWithAppId:@"random#123456" andDelegate:self];
[self login];
(下面我登录方法)
- (void) login {
NSArray *permissionsArray = [NSArray arrayWithObjects:@"email", nil];
[facebook authorize:permissionsArray];
}
(和我的Facebook请求方法...)
- (void)request:(FBRequest *)request didLoad:(id)result {
NSLog(@"Inside didLoad");
if ([result isKindOfClass:[NSArray class]]) {
result = [result objectAtIndex:0];
}
// When we ask for user infor this will happen.
if ([result isKindOfClass:[NSDictionary class]]){
//NSDictionary *hash = result;
NSLog(@"Name: %@", [result objectForKey:@"name"]);
}
if ([result isKindOfClass:[NSData class]])
{
NSLog(@"Profile Picture");
//[profilePicture release];
//profilePicture = [[UIImage alloc] initWithData: result];
}
NSLog(@"request returns %@",result);
//if ([result objectForKey:@"owner"]) {}
};
- (void)request:(FBRequest *)request didFailWithError:(NSError *)error{
NSLog(@"%@",error);
}
我真的很困惑,为什么我得到一个错误,我需要更改或添加以修复它...
任何想法?
编辑:我的请求代码:::
- (IBAction)requestFBFriends:(id)sender {
NSLog(@"HERE");
[facebook requestWithGraphPath:@"me/friends" andDelegate:self];
}
我不知道有关的权限验证你正在使用,但在我的应用程序中,我使用“电子邮件”作为唯一的权限,这使您可以访问联系人电子邮件,名称是一个基本的权限,所以你不需要指定它 – Moxy 2012-07-21 13:06:25
@Moxy我改变了我的权限只有电子邮件,我仍然得到相同的错误... – 2012-07-21 13:08:12
请问您可以添加您的请求代码,还可以在哪里调用它? – Moxy 2012-07-21 13:57:28