简体   繁体   English

iOS:使用FBWebDialogs在选定的FB朋友的墙上张贴

[英]iOS: Post on wall of Selected FB Friends using FBWebDialogs

I can post image to facebook friend's wall using FBWebDialogs.What am looking is how can i post image to multiple Friends... Below is my code for single post 我可以使用FBWebDialogs.image将图片发布到Facebook朋友的墙上。我正在寻找如何将图片发布到多个朋友的网站。

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"Sharing Tutorial", @"name",
                               @"Build great social apps and get more installs.", @"caption",
                               @"Allow your users to share stories on Facebook from your app using the iOS SDK.", @"description",
                               @"https://developers.facebook.com/docs/ios/share/", @"link",
                               @"http://i.imgur.com/g3Qc1HN.png", @"picture",
                               @"100006771363037",@"to",
                                nil];

// Show the feed dialog
[FBWebDialogs presentFeedDialogModallyWithSession:nil
                                       parameters:params
                                          handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
                                            if (error) {
                                              // An error occurred, we need to handle the error
                                              // See: https://developers.facebook.com/docs/ios/errors
                                              NSLog(@"Error publishing story: %@", error.description);
                                            } else {
                                              if (result == FBWebDialogResultDialogNotCompleted) {
                                                // User canceled.
                                                NSLog(@"User cancelled.");
                                              } else {
                                                // Handle the publish feed callback
                                                NSDictionary *urlParams = [self parseURLParams:[resultURL query]];

                                                if (![urlParams valueForKey:@"post_id"]) {
                                                  // User canceled.
                                                  NSLog(@"User cancelled.");

                                                } else {
                                                  // User clicked the Share button

                                                    NSLog(@"fb web dialog result=====>%@",result);
                                                  NSString *result = [NSString stringWithFormat: @"Posted story, id: %@", [urlParams valueForKey:@"post_id"]];
                                                  NSLog(@"result %@", result);
                                                }
                                              }
                                            }
                                          }];

While adding friends profile_id's separated by comma in @"to" field getting error.Added screen shot in below 在@“至”字段中添加朋友profile_id时,用逗号分隔时出现错误。在下面添加了屏幕截图

You cannot add multiple ids in the to parameter in a Feed Dialog . 您不能在Feed对话框to参数中添加多个ID。 In fact there's no way to post a feed to multiple friends at once. 实际上,无法一次将提要发布给多个朋友。 You have to invoke the dialog for each of the friend separately. 您必须分别为每个朋友调用对话框。

According to documentation , to is: 根据文档to是:

The ID or username of the profile that this story will be published to. 此故事将发布到的配置文件的ID或用户名。 If this is unspecified, it defaults to the value of from. 如果未指定,则默认为from的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM