Reputation: 93
I am getting the following error when attempting to post to OpenGraph using the Share Dialog with the FB iOS SDK v 3.17.0.:
Error : Error Domain=com.facebook.Facebook.platform Code=102 "The operation couldn’t be completed. (com.facebook.Facebook.platform error 102.)" UserInfo=0x176d43a0 {error_code=102, error_description=An error occurred during publishing., app_id=xxxxxxxxxxx, error_reason=The operation couldn’t be completed. (FBAPIErrorDomain error 2500.)}
This error is returned by handler callback of the presentShareDialogWithOpenGraphAction method. When calling this method, the transition to the FB App occurs and the contents of the post are shown in the UI (although, the supplied photo shows briefly and then disappears). I also see an alert dialog in the FB App stating:
Oops, Something Went Wrong. There was a problem posting your status. We've logged the error and will look into it.
After pressing Post
in the FB app, my app opens again with the above error message.
The (abbreviated) code for what I am doing is below. Note that my object type is gift
, my custom method is send
, and both appear to be set up correctly on the developer site. Any help is much appreciated.
id<FBGraphObject> object = [FBGraphObject openGraphObjectForPostWithType:@"myNamespace:gift"]
title:@"Gifter"
image:@"http://imgur.com/gallery/Omhe1V3"
url:@"http://www.myAppsUrl.com"
description:@"A gift for you"];
id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
[action setObject:object forKey:@"gift"];
[action setTags:@[targetFacebookId]]; ///S.O. Note: The Id is obtained elsewhere.
FBOpenGraphActionParams *params = [[FBOpenGraphActionParams alloc] init];
params.action = action;
params.actionType = @"myNamespace:send";
// If the Facebook app is installed and we can present the share dialog
if([FBDialogs canPresentShareDialogWithOpenGraphActionParams:params]) {
// Show the share dialog
[FBDialogs presentShareDialogWithOpenGraphAction:action
actionType:@"myNamespace:send"
previewPropertyName:@"gift"
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
NSLog(@"Error : %@",error);
}];
}
Upvotes: 0
Views: 670
Reputation: 5084
Look carefully on the parameters you provide. FB doesn't tell you what's wrong but just returns this general error. I just had the same problem and apparently my namespace was wrong.
So my suggestion - double and triple check all the params you are passing to FB
Upvotes: 1