0

I'm trying to post an Open Graph Story, being logged to my app with Facebook test account. Story contnents: Name shared a link.

Facebook's instructions to get a permission is a vicious circle!

To post I need a permission, For permission I got to post something. So when I'm trying to post a story from the app. App goes to Facebook app, creates a template for post. But when press "Publish" nothing's happen.

Please, help me to solve a problem. Our company tried everything, changed code etc, but I think it's Facebooks problem. Please, help me to find out why posts do not publish to Facebook.

PS: We do not use share dialog in this case, we are using Open Graph with API 2

Partners
  • 1
  • 1
  • You have given a very blurry description of what you are doing or have done so far. Are you building a mobile app - iOS/Android? Or is it a web app? It is also confusing when you state that you are not using the share dialog but your 'app goes to Facebook app creates a template for post' which essentially is the Share Dialog. If you can provide more details then we may be able to help you. – bangdel May 01 '15 at 14:14
  • We have an iOS app. Right now it uses Share dialog to post, which somehow works time at a time. But we want to use publish actions, created action types, objects, actions - all that is needed. But Facebook says to use publish actions we need to call a precreated action, which need publish actions permission at the same time! – Partners May 06 '15 at 09:40

1 Answers1

1

If you just want to share a link then use the following code:

FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:@"http://developers.facebook.com"];
[FBSDKShareDialog shareFromViewController:self
                              withContent:content
                                 delegate:nil];

In the composer leave 'Say something about this...' blank and the story will show up in the Timeline as "Name shared a link"

If it is a custom OG story, then use the Share Dialog; you do not need to explicitly get publish_actions permission. If Share Dialog does not seem to post to Timeline, set the delegate for the dialog and you can use the delegate method to investigate the cause.

-(void)sharer:(id<FBSDKSharing>)sharer didFailWithError:(NSError *)error {
    NSLog(@"Error: %@", error);
}

As for creating actions and objects, you can do so in your app dashboard:

https://developers.facebook.com/apps/<your-facebook-app-id>/open-graph/

If you need permissions to make Graph API calls then implement login with Facebook and it is here that you request the permissions that your app needs. For example:

FBSDKLoginButton *loginButton = [[FBSDKLoginButton alloc] init];
loginButton.readPermissions = @[@"public_profile", @"user_photos"];
loginButton.publishPermissions = @[@"publish_actions"];

Once you have the permissions in place you can make Graph API calls.

bangdel
  • 2,523
  • 5
  • 28
  • 42