这是我的代码,我在这里做错了什么?请记住,我正在使用 FBLoginView 并且其他字符串返回实际有效结果,而不是年龄范围。在此先感谢,-丹尼尔
- (void)loginViewFetchedUserInfoFBLoginView *)loginView
userid<FBGraphUser>)user {
NSString *userID = [NSString stringWithFormat"%@", user.objectID]; //objectID instead?
NSLog(@"userID = %@", userID);
NSString *nameFull = [NSString stringWithFormat"%@", user.name];
NSLog(@"nameFull = %@", nameFull);
NSString *firstName = [NSString stringWithFormat"%@", user.first_name];
NSLog(@"firstName = %@", firstName);
NSString *middleName = [NSString stringWithFormat"%@", user.middle_name];
NSLog(@"middleName = %@", middleName);
NSString *lastName = [NSString stringWithFormat"%@", user.last_name];
NSLog(@"lastName = %@", lastName);
NSString *link = [NSString stringWithFormat"%@", user.link];
NSLog(@"link = %@", link);
NSString *gender = [NSString stringWithFormat"%@", [user objectForKey"gender"]];
NSLog(@"gender = %@", gender);
NSDictionary *ageRangeDict = [user objectForKey"user_age_range"];
NSString *ageRange = [NSString stringWithFormat"%@-%@",
[ageRangeDict objectForKey:@"min"],
[ageRangeDict objectForKey:@"max"]];
NSLog(@"ageRange = %@", ageRange);
}
Best Answer-推荐答案 strong>
改变这一行:
NSDictionary *ageRangeDict = [user objectForKey:@"user_age_range"];
到这里:
NSDictionary *ageRangeDict = [user objectForKey:@"age_range"];
引用:Link
关于ios - Facebook 开发者 API iOS,age_range 返回 NULL,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/25106602/
|