FBConnect iphone:我无法获取某个帐户的相册?

发布于 2024-09-19 03:34:47 字数 799 浏览 5 评论 0原文

也许有人帮不了我。

我使用最后一个 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/相册)对于不能在 iPhone 上使用的帐户,列表不为空?

在 iPhone 上,我使用图形 api 或 FQL 得到相同的结果(“从专辑中选择援助,其中所有者=我()”)

也许我错过了一些有关 facebook 应用程序配置的思考?

感谢您的回答。

Maybe someone can't help me.

I use the last FBConnect (http://github.com/facebook/facebook-ios-sdk/) for Facebook connexion.
And I retreive the list of photos albums for the user.

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

I'm testing with 4 differents account with all the same rules for privacy (Account/Privacy settings). And for some of them the albums list is empty ? And if i test via a webbrowser on a desktop computer (https://graph.facebook.com/me/albums) for account who doesn't work on iphone, the list is not empty ?

On iphone, i use graph api or FQL with same results ("SELECT aid FROM album WHERE owner = me()")

Maybe i miss some think about configuration off the facebookapp ?

Thanks for answer.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

羁绊已千年 2024-09-26 03:34:47

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

I resolve the solution with good settings for facebook authentifications
http://developers.facebook.com/docs/authentication/permissions

梦罢 2024-09-26 03:34:47

这会将相册的所有图像放入源数组中!

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

}

THIS WILL PUT ALL THE IMAGES OF THE ALBUM IN SOURCE ARRAY!

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

}
玉环 2024-09-26 03:34:47

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

publish_actions and user_photos permissions is required.

And then please try the following code :

[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);
                          }
 }];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文