【问题标题】:FBConnect iphone : I coud'nt get Photos albums for some account ?FBConnect iphone:我无法为某些帐户获取相册?
【发布时间】:2010-09-15 12:37:50
【问题描述】:

也许有人帮不了我。

我使用最后一个 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 配置的想法?

感谢您的回答。

【问题讨论】:

    标签: iphone objective-c facebook fbconnect


    【解决方案1】:

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

    【讨论】:

    • 你能具体说一下你必须添加的权限吗?我在此页面中找不到与专辑相关的任何内容...
    【解决方案2】:

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

    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"]];
    
    }
    

    【讨论】:

      【解决方案3】:

      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);
                                }
       }];
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-03-20
        • 2020-03-29
        • 2022-07-26
        相关资源
        最近更新 更多