2
votes

No matter what I do, I get this error when I share:

2014-02-03 00:13:36.392 Kurt Osiander[4443:60b] Error publishing story: Error Domain=com.facebook.Facebook.platform Code=102 "The operation couldn’t be completed. (com.facebook.Facebook.platform error 102.)" UserInfo=0x15d475b0 {error_message=An error occurred during publishing., app_id=xxxxxxxxxx, error_code=102}

I've disabled sandbox mode and messed around with open graph options (Facebook posting error in ios) with no luck. My code is attached below:

// Check if the Facebook app is installed and we can present the share dialog

    FBShareDialogParams *params = [[FBShareDialogParams alloc] init];
    params.link = [NSURL URLWithString:@"https://http://www.kurtosiander.com/"];
    params.name = @"Kurt Osiander's Move of the Week";
    params.caption = @"Kurt Osiander's Move of the Week";
    params.picture = [NSURL URLWithString:@"http://a5.mzstatic.com/us/r30/Purple/v4/4b/7e/73/4b7e737c-bdc1-2aa5-3288-4e76c658235b/mzl.yafqehvw.175x175-75.jpg"];
    params.description = @"Kurt's iPhone app is finally available! Check it out now to learn all his moves, organized by position and submission.";

    // If the Facebook app is installed and we can present the share dialog
    if ([FBDialogs canPresentShareDialogWithParams:params]) {
        // Present share dialog
        NSLog(@"Present Dialog");
        [FBDialogs presentShareDialogWithLink:params.link
                                         name:params.name
                                      caption:params.caption
                                  description:params.description
                                      picture:params.picture
                                  clientState:nil
                                      handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
                                          NSLog(@"handling");
                                          if(error) {
                                              // An error occurred, we need to handle the error
                                              // See: https://developers.facebook.com/docs/ios/errors
                                              NSLog(@"%@", [NSString stringWithFormat:@"Error publishing story: %@", error.description]);
                                          } else {
                                              // Success
                                              NSLog(@"result %@", results);
                                          }
                                      }];

In my app delegate:

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation {

    BOOL urlWasHandled = [FBAppCall handleOpenURL:url
                                sourceApplication:sourceApplication
                                  fallbackHandler:^(FBAppCall *call) {
                                      NSLog(@"Unhandled deep link: %@", url);
                                      // Here goes the code to handle the links
                                      // Use the links to show a relevant view of your app to the user
                                  }];

    return urlWasHandled;
}
1
My FacebookDisplayName is the same for my plist entry and my Facebook app settings. Unfortunately, this is not the issue. - Hooman Ahmadi
still you have this problem? - Pawan Rai
yes i still have the issue... everything i saw that people said fixed the issue didn't work for me. - Hooman Ahmadi

1 Answers

0
votes

I have a similar problem and I think they are bosed based on the facebook display name. In yours there is a special character and in mine there is a german umlaut.

So I would suggest to remove the special character (') on the facebook app and in the plist. I hope this helps even if this is not a satisfyinf soultion for the problem (FacebookDisplayName on iOS with german umlauts [SOLVED]).

UPDATE: I found a soultion! The problem is a result of the utf8 string representation and the linked string comparision difference. Here is my workaround:

[FBSettings setDefaultDisplayName:[[FBSettings defaultDisplayName] precomposedStringWithCanonicalMapping]];