Question: I am wondering if it's possible to post something on a user's facebook wall using SLComposeViewController but without showing the share sheet/dialog?

Following is the code I am using:

```
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {

        SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];

        SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result){
            if (result == SLComposeViewControllerResultCancelled) {

                NSLog(@"Cancelled");

            } else

            {
                NSLog(@"Done");
            }

            [controller dismissViewControllerAnimated:YES completion:Nil];
        };
        controller.completionHandler =myBlock;

        [controller setInitialText:eventInfoToFacebook];

        [self presentViewController:controller animated:YES completion:Nil];

    }

```

Thanks in advance.

Answer: 
Import the Social Framework:

```
#import <Social/Social.h>

```

-

```
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {

        SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];

        SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result){
            if (result == SLComposeViewControllerResultCancelled) {

                NSLog(@"Cancelled");

            } else

            {
                NSLog(@"Done");
            }

            [controller dismissViewControllerAnimated:YES completion:Nil];
        };
        controller.completionHandler =myBlock;

        [controller setInitialText:@"Test Post from mobile.safilsunny.com"];
        [controller addURL:[NSURL URLWithString:@"http://www.mobile.safilsunny.com"]];
        [controller addImage:[UIImage imageNamed:@"fb.png"]];

        [self presentViewController:controller animated:YES completion:Nil];

    }
    else{
        NSLog(@"UnAvailable");
    }

}

```

/

```
//Deprecated in iOS6

    ACAccountStore *accountStore = [[ACAccountStore alloc] init];
    ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];

    [accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) {

        ACAccount *account = [[ACAccount alloc] initWithAccountType:accountType];
        NSLog(@"%@, %@", account.username, account.description);
    }];

```
this is possible in facebook-ios-sdk 3.0.
[here](https://developers.facebook.com/ios/)

i am making the share with this code.

```
 [FBRequestConnection startWithGraphPath:@"me/feed"
                             parameters:params
                             HTTPMethod:@"POST"
                      completionHandler:^(FBRequestConnection *connection,
                                          NSDictionary * result,
                                          NSError *error) {
                          if (error) {
                              NSLog(@"Error: %@", [error localizedDescription]);
                          } else {

                              }
                      }];

```

i called this method when user clicks share button and there is no dialog with the user it directly post to the users wall. params is parameters that sharing includes.