1
我有我的应用程序设置这些Facebook的权限:Facebook SDK加载默认图像,而不是从我的个人资料图像,为什么?
NSArray *permissions = [[NSArray alloc] initWithObjects:
@"user_games_activity",
@"friends_games_activity",
@"publish_actions",
@"user_photos",
nil];
[[myDelegate facebook] authorize:permissions];
我做的请求,像这样:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"name,picture",@"fields",nil];
[[delegate facebook] requestWithGraphPath:@"me" andParams:params andDelegate:self];
和处理类似的回应:
else if([request.url rangeOfString:@"me"].location != NSNotFound)
{
NSString *username = [result objectForKey:@"name"];
NSLog(@"We think the username is %@", username);
helloGreeting.text = [NSString stringWithFormat:@"Hello %@", username];
NSString *pictureUrl = [result objectForKey:@"picture"];
NSLog(@"Now loading image [%@]", pictureUrl);
NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:pictureUrl]];
profilePhoto.image = [UIImage imageWithData:data];
}
我得到的日志输出是:
2012-06-26 15:10:49.002 FacebookIntegrator[10549:f803] We think the username is James Elsey
2012-06-26 15:10:49.003 FacebookIntegrator[10549:f803] Now loading image [http://profile.ak.fbcdn.net/static-ak/rsrc.php/v2/yo/r/UlIqmHJn-SK.gif]
问题:为什么它获得默认通用的Facebook图标,而不是我自己的个人资料图片?使用上Graph Explorer相同的访问令牌,我可以得到我的个人资料图片图像URL
的documentation为user_photos
状态:
提供对用户上传的照片,照片 用户已