Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9252523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:57:57+00:00 2026-06-18T10:57:57+00:00

I am trying to build simple prototype where I post some text to my

  • 0

I am trying to build simple prototype where I post some text to my facebook account. I have read the ios 6 facebook integration documentation and came up with following code. Everything seems to work fine until I hit the last block where I create SLRequest object in method postTextToFacebook and try to execute performRequestWithHandler with handler block. Control never does inside the handler block. I am assuming that performRequestWithHandler call is not successful in this case. Any one have done with successfully? Here is code for your reference.

#import <Social/Social.h>
#import "ViewController.h"

@implementation ViewController
@synthesize facebookAccount;
@synthesize accountStore;
@synthesize textToPost;

- (void)viewDidLoad
{
    [super viewDidLoad];


}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];

}


-(IBAction) postToFacebook:(id)sender
{
    self.statusLabel.text = @"Logging in ...";
    if(self.accountStore == nil)
    {
        self.accountStore = [[ACAccountStore alloc] init];
    }

    ACAccountType *facebookAccountType = [self.accountStore enter code hereaccountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];

    NSMutableDictionary *myOptions = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                    @"172197712918906", ACFacebookAppIdKey,
                                    [NSArray arrayWithObjects:@"email", @"user_about_me", @"user_likes", nil], ACFacebookPermissionsKey, ACFacebookAudienceFriends, ACFacebookAudienceKey, nil];
    [self.accountStore requestAccessToAccountsWithType:facebookAccountType options:myOptions completion:^(BOOL granted, NSError *error){
        __block NSString *statusText;
        if(granted)
        {
            NSArray *accounts = [self.accountStore accountsWithAccountType:facebookAccountType];
            self.facebookAccount = [accounts lastObject];
            [myOptions setObject:[NSArray arrayWithObjects:@"publish_stream", nil] forKey:ACFacebookPermissionsKey];
            [self.accountStore requestAccessToAccountsWithType:facebookAccountType options:myOptions completion:^(BOOL granted, NSError *error) {
                 __block NSString *statusText1;
                if(granted && error == nil)
                {
                    NSArray *accounts = [self.accountStore accountsWithAccountType:facebookAccountType];
                    self.facebookAccount = [accounts lastObject];
                    [self postTextToFacebook];
                    statusText1 = @"Text Posted.";
                }
                else{
                    statusText1 = @"Publish Failed.";
                }

                dispatch_async(dispatch_get_main_queue(), ^{
                    self.statusLabel.text = statusText1;
                });
            }];
        }
        else{
            statusText = @"Login Failed.";
            NSLog(@"Error = %@",error);
        }


    }];

}

-(void) postTextToFacebook
{
    NSDictionary *parameters = @{@"message":self.textToPost.text};
    NSURL *feedURL = [NSURL URLWithString:@"https://graphs.facebook.com/me/feed"];

    SLRequest *request = [SLRequest requestForServiceType:SLServiceTypeFacebook requestMethod:SLRequestMethodPOST URL:feedURL parameters:parameters];

    request.account = self.facebookAccount;

    [request performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {        
        NSLog(@"Facebook request received, status code %d", urlResponse.statusCode);
        NSString *response = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
        NSLog(@"Response data: %@", response);

        //handle errors
        if(error == nil)
        {
            dispatch_async(dispatch_get_main_queue(), ^{
                self.statusLabel.text = @"text posted to facebook";
            });
        }

    }];
}

@end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:57:58+00:00Added an answer on June 18, 2026 at 10:57 am

    Your url should be

    https://graph.facebook.com/me/feed

    instead of

    https://graphs.facebook.com/me/feed

    I was having a same issue and got an NSURLErrorDomain -1003 error on it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a simple html page which include some text paragraph, during
I'm trying to build simple facebook application with 4.2.1 C# SDK. But I have
I'm trying to build a simple HTML text editor in a Windows Form application.
Trying to build a simple 1-1 with XMPP protocol like on facebook ( offline,
I am trying to build a simple shopping cart, i read about controlling them
I'm trying to build a simple component extending spark.components.Group to have a background color,
I am trying to build a simple vertical thermometer with CSS. I took some
I'm trying to build a simple .Net wrapper around some basic C++ code. The
I trying to build a simple lib for persistence with guice persist and some
Im trying to build a simple application in python, where I have tags that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.