FBSDK OpenGraph issues on Object and Action

146 Views Asked by At

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.)

0

There are 0 best solutions below