*目前,我的计划是查询用户的相册,然后遍历这些相册并获取所有图像。有没有完全跳过专辑步骤的好方法?这是我用来获取 > 他们的相册信息的代码: - 我想获取相册列表。我使用 > 以下代码但没有运气。
-(IBAction)updateStatus:(id)sender {
if (FBSession.activeSession.isOpen) {
[self promptUserWithAccountNameForStatusUpdate];
} else {
NSArray *permissions = [[NSArray alloc] initWithObjects:
@"publish_stream",@"user_photos",
nil];
[self controlStatusUsable:NO];
[FBSession openActiveSessionWithPermissions:permissions
allowLoginUI:YES
completionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
// if login fails for any reason, we alert
if (error) {
} else if (FB_ISSESSIONOPENWITHSTATE(status)) {
[[FBRequest requestForMe] startWithCompletionHandler:
^(FBRequestConnection *connection,
NSDictionary<FBGraphUser> *user, NSError *error) {
if (!error) {
[FBRequestConnection startWithGraphPath:@"me/albums" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if (!error) {
NSString *urlstr=[NSString stringWithFormat:@"https://graph.facebook.com/me/friends?access_token=%@&fields=id,picture,name,birthday",[[FBSession activeSession]accessTokenData]];
NSLog(@"the tkens:%@",urlstr);
int j=0;
NSLog(@"Results: %@", result);
NSString *fbAccessToken = [[[FBSession activeSession] accessTokenData] accessToken];
//NSLog(@"get access:%@",fbAccessToken);
}
}
];
}
[self controlStatusUsable:YES];
}];
}
}];
}
}
请任何人给我想法或参考。