2

也许有人帮不了我。

我将最后一个 FBConnect ( http://github.com/facebook/facebook-ios-sdk/ ) 用于 Facebook 连接。我为用户检索相册列表。

NSMutableDictionary* params = [NSMutableDictionary NictionaryWithObjectsAndKeys:_facebook.accessToken,@"access_token",nil];
[_facebook requestWithGraphPath:@"me/albums" andParams:params andDelegate:self];

我正在使用 4 个不同的帐户进行测试,这些帐户具有所有相同的隐私规则(帐户/隐私设置)。对于其中一些人来说,专辑列表是空的?如果我通过台式计算机(https://graph.facebook.com/me/albums)上的网络浏览器测试无法在 iphone 上使用的帐户,列表不为空吗?

在 iphone 上,我使用具有相同结果的图形 api 或 FQL(“SELECT aid FROM album WHERE owner = me()”)

也许我想念一些关于 facebookapp 配置的想法?

感谢您的回答。

4

3 回答 3

2

我通过良好的 facebook 身份验证设置解决了解决方案 http://developers.facebook.com/docs/authentication/permissions

于 2010-09-15T12:51:16.950 回答
0

这会将专辑的所有图像放入源数组中!

NSURL *url1 = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/photos&access_token=AAACeFkezepQBANpoFq9I3Hts0JdE6Xis3UpZBqNxpgw62zWSlhSYyYcluGaaxH3IlKIh9w8OYrXYF9MsAxhk6ta1ANZClCaznpdSaERgZDZD",A_ID]];
    URLWithString:@"https://graph.facebook.com/114750591966408/photos&access_token=//AAACeFkezepQBANpoFq9I3Hts0JdE6Xis3UyYcluGaaxH3IlKIh9w8OYrXYF9MsAxhk6ta1ANZClCaznpdSaERgZDZD"];
    NSData *data1 = [NSData dataWithContentsOfURL:url1];
    NSString *str1=[[NSString alloc] initWithData:data1 encoding:NSASCIIStringEncoding];
    // NSString *str1=[[NSString alloc]ini]
    NSDictionary *userData1 = [str1 JSONValue];
    NSArray *arrOfimages=[userData1 objectForKey:@"data"];
    NSMutableArray *sourceUrls = [[NSMutableArray alloc] initWithCapacity:0];

for(NSDictionary *subDictionary in arrOfimages) 
{

 [sourceUrls addObject:[subDictionary objectForKey:@"picture"]];

}
于 2012-08-21T12:25:15.890 回答
0

需要 publish_actions 和 user_photos 权限。

然后请尝试以下代码:

[FBRequestConnection startWithGraphPath:@"me/albums"
                      completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
                          if (!error) {
                              // Success! Include your code to handle the results here
                              NSLog(@"user events: %@", result);
                              NSArray *feed =[result objectForKey:@"data"];

                              for (NSDictionary *dict in feed) {

                                  NSLog(@"first %@",dict);

                              }
                          } else {
                              // An error occurred, we need to handle the error
                              // Check out our error handling guide: https://developers.facebook.com/docs/ios/errors/
                              NSLog(@"error %@", error.description);
                          }
 }];
于 2014-11-26T22:46:01.343 回答