简体   繁体   中英

facebook open graph for iOS error during publishing

I am trying to submit what I think is a pretty basic open graph post on facebook in iOS7. I am using the latest version of everything, including facebook's SDK version 3.10.

My app brings up the share dialog preloaded with the parameters from my FBGraphObject . I even had an image URL in there earlier that shows in the preview, just took it out trying to troubleshoot. I type a few words in the "Say something about this..." part of the share dialog and tap "Post." This is the error I get:

Error Domain=com.facebook.Facebook.platform Code=102 "The operation couldn't be completed. (com.facebook.Facebook.platform error 102.)" UserInfo=0x19192ba0 {error_message=An error occurred during publishing., app_id=299416296871047, error_code=102}

I can't seem to find another question with this same error. Here is my code:

id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
        NSMutableDictionary<FBGraphObject> *object =
        [FBGraphObject openGraphObjectForPostWithType:@"og.item"
                                                title:@"Test Post"
                                                image:nil
                                                  url:@"https://mywebsiteurl.com"
                                          description:@"A test post"];
        [action setObject:object forKey:@"something"];

[FBDialogs presentShareDialogWithOpenGraphAction:action
                                              actionType:@"og.publish"
                                     previewPropertyName:@"something"
                                                 handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
                                                     if(error) {
                                                         NSLog(@"Error: %@", error.description);
                                                         NSLog(@"Results: %@", results);
                                                     } else {
                                                         NSLog(@"Success.");
                                                     }//end if
                                                 }];

Any ideas?

I had the same problem. It turned out to be permission issue. Facebook user that that I used to post OG story wasn't administrator or the developer in the Facebook app roles and permissions.

In order to use it with any user your app has to be reviewed by Facebook.

I had the exact same problem. What's the size of the OG object in the URL? Mine was rather large and the Facebook app was not waiting long enough to complete the post.

At the moment i'm publishing successfully via FBRequestConnection startForPostWithGraphPath

// create object
id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
[action setObject:url forKey:@"something"];
[action setObject:@"true" forKey: @"fb:explicitly_shared"];

[FBRequestConnection startForPostWithGraphPath:@"me/og.item"
                                   graphObject:action
                             completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
}];

Make sure the 'Explicitly Shared' option for this action type is enables in the App Dashboard.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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