Facebook分享在iOS上显示空白图像,但在桌面上工作正常

时间:2015-02-04 23:28:51

标签: ios facebook addthis

我正在使用以下页面中的AddThis:http://www.douglasstratton.com/Beaches/Amnesia/flypage.tpl.html

从桌面共享时,图像共享正常,但在iOS上共享时,Facebook墙上的图像为空白。

还有其他人有这个问题吗?

1 个答案:

答案 0 :(得分:0)

You can share with this code.Only import #import <FacebookSDK/FacebookSDK.h>:-
  // Put together the dialog parameters
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   APP_NAME, @"name",
                                   self.strSerialName , @"caption",
                                   modelObject.strChapterDescription, @"description",
                                   @"", @"link",
                                   modelObject.strChapterImage, @"picture",
                                   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 cancelled.
                                                          NSLog(@"User cancelled.");
                                                      } else {
                                                          // Handle the publish feed callback
                                                          NSDictionary *urlParams = [self parseURLParams:[resultURL query]];

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

                                                          } else {
                                                              // User clicked the Share button
                                                              NSString *result = [NSString stringWithFormat: @"Posted story, id: %@", [urlParams valueForKey:@"post_id"]];
                                                              NSLog(@"result %@", result);
                                                          }
                                                      }
                                                  }
                                              }];