0

I have been trying to add an OpenGraph post for quite some time but I cannot figure out the current documentation and broken links to tutorials.

Relevant setup (values are made up): FB namespace: "spot_app" Open Graph Object Types: "Spot", inherits from Place as this will include a link to a place in google maps.

I am trying to have the story: "UserX saved a Spot", followed by a user comment and business information.

Relevant code:

NSDictionary *properties = @{@"og:type":@"spot_app:Spot",
                             @"og:title":@"Spot OpenGraph Title",
                             @"og:description":@"Spot Description",
                             @"og:site_name":@"spotAppSite.com",
                     @"og:url":googleURL};

FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];
FBSDKShareOpenGraphAction *action = [FBSDKShareOpenGraphAction actionWithType:@"save.saves" object:object key:@"spot_app:Spot"];

FBSDKShareOpenGraphContent *content = [FBSDKShareOpenGraphContent new];
content.action = action;
content.previewPropertyName = @"spot_app:Spot";

FBSDKShareAPI *shareAPI = [FBSDKShareAPI new];
shareAPI.shareContent = content;
shareAPI.delegate = self;
[shareAPI share];

The documentation around FBSDKShareOpenGraphAction is quite poor and says several different things in several different places about how to use the "save" action.

Guidance on where I am going wrong? I currently get the error: Failed: The operation couldn’t be completed. (com.facebook.sdk.share error 201.)

Raesu
  • 310
  • 2
  • 15
  • Try the “Get Code” button available for each of your OG stories, actions and objects in app dashboard. – CBroe Aug 11 '16 at 07:54
  • https://developers.facebook.com/docs/sharing/opengraph/custom – Sandy Patel Aug 11 '16 at 11:31
  • Thank you @CBroe, that is helpful! I fixed the code for my object but I can't get this to work with the "save" action. I can create a custom action and use that, but I really need the "save" action that they reserve for standard use. However I can't get the right string...I have seen "save.saves", "pages.save" etc and all combinations I get error 201. – Raesu Aug 12 '16 at 01:04

0 Answers0