15
votes

I have done all steps that are explained here: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/3.1/

I have tested the demo projects and fail the same as on my project. (you can test it on HelloFacebookSample project).

When you don't have any Facebook account configured, you can't share something on facebook, or upload an image etc, (the same as twitter framework). So the frameworks shows you a message that tells this:

There are no Facebook accounts configured. You can add or create a Facebook account in Settings.

You click on settings but the only thing that happends is that this dialog is hided, but the framework doesn't open the Settings tab (as work on for example on the twitter framework).

Does anyone know how to solve this problem?

Thanks in advance.

2
I have the same error. The only thing I found out is that this error is only on simulator. Still, I don't have iOS 6 device right now, so I can't test, whether it's true.valdistt

2 Answers

1
votes

Please use SLComposeViewController class for Facebook sharing, setting button work for you.

if([SLComposeViewController class])
{
    SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
    [controller setInitialText:text];
    [controller addURL:[NSURL URLWithString:encod]];
    [self presentViewController:controller animated:YES completion:Nil];
    //[message release];

    SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result)
    {
        NSString *output= nil;
        switch (result)
        {
            case SLComposeViewControllerResultCancelled:
                output= @"Action Cancelled";
                break;
            case SLComposeViewControllerResultDone:
                output= @"Post Succesfull";
                [self displayText:@"done"];
                break;
            default:
                break;
        }

     };
    controller.completionHandler =myBlock;
}

This code is working for me

0
votes

Why dont u use UIActivityViewController ? iOS 6 have the best support with UIActivityViewController

UIActivityViewController *ActivityView = [[UIActivityViewController alloc] initWithActivityItems:Items applicationActivities:nil];

Best Integration for Facebook, Twitter and sms Service