質問

I followed the set up for my own application. https://developers.facebook.com/docs/ios/getting-started/

I then used the overview example, found here: https://developers.facebook.com/docs/ios/share-dialog/

NSURL* url = [NSURL URLWithString:@"https://developers.facebook.com/"];
[FBDialogs presentShareDialogWithLink:url
                          handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
    NSLog(@"Error: %@", error.description);
  } else {
    NSLog(@"Success!");
 }
}];

The share dialog appears, like in the example. I press post and it successfully returns to the app. All looks like its working right? But when I return to the facebook wall and my profile there is no status update. The logs are not displayed so something is going wrong.

if(error) {
    NSLog(@"Error: %@", error.description);
} else {
    NSLog(@"Success!");
}

Any ideas? Facebook redirect you to stackoverflow to get help because they have facebook developers registered.

役に立ちましたか?

解決

First, the final part on the first link, about the .plist, is really important. It has to be with the correct info from your app, in order to the share feature to work. Re-check that if you can.

Anyway, the NSLog not printing anything on the console is strange, have you tried searching(command + f) for the message output on the console? Did you try debugging your app and putting breaking points on the 'if' condition to see the state of the error instance?

I don't know if you didn't put it here, or forgot to do it on code, but are you logging the user and checking if the facebook user session is valid? That has to be checked in order for the share to work.

PS: If you are using your facebook App on sandbox mode, any share you do, will only appear on the timeline of the users that are allowed to use the fbApp.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top