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

  • SEARCH
  • Home
  • 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 5966649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:49:48+00:00 2026-05-22T19:49:48+00:00

Im just starting out with the Facebook SDK for iOS and checked out the

  • 0

Im just starting out with the Facebook SDK for iOS and checked out the documentation and other help thoroughly but can’t be successful.

I have started a new view based app and authorised just as recommended in the docs. Everytime I start the app its switches to the Facebook app (which I have installed on my iPhone) and says already authorised, press okay. How can I stop it repeatedly doing this?

I also have tried posting to Facebook without a dialog. The console tells me a request is made but then a error occurs (doesn’t crash but the didFailWithError tells me).

Anyway I haven’t posted any of my code as it seems relatively simple so if there is someone who knows how to do this I would massively appreciate any help, and possibly even a code sample.

Thanks.

  • 1 1 Answer
  • 3 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-05-22T19:49:49+00:00Added an answer on May 22, 2026 at 7:49 pm

    You’re missing a key point in your delegate, you have to save the session data yourself

    - (void)fbDidLogin {
        // store the access token and expiration date to the user defaults
        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        [defaults setObject:facebook.accessToken forKey:ACCESS_TOKEN_KEY];
        [defaults setObject:facebook.expirationDate forKey:EXPIRATION_DATE_KEY];
        [defaults synchronize];
    }
    

    And then when you initialize facebook you would do the following

    facebook = [[Facebook alloc] initWithAppId:kAppId];
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    facebook.accessToken = [defaults objectForKey:ACCESS_TOKEN_KEY];
    facebook.expirationDate = [defaults objectForKey:EXPIRATION_DATE_KEY];
    

    And finally, if you want to post without a dialog you would do this

    NSString *message = @"Visit my blog http://effectivemobility.blogspot.com/";
    NSArray *obj = [NSArray arrayWithObjects:message, nil];
    NSArray *keys = [NSArray arrayWithObjects:@"message", nil];
    
    // There are many other params you can use, check the API
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjects:obj forKeys:keys];
    
    [facebook requestWithGraphPath:@"me/feed" andParams:params andHttpMethod:@"POST" andDelegate:nil];
    

    I hope that helps

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

Sidebar

Related Questions

Just starting out with my first commercial app for the iStore but dont have
I'm just starting out with Facebook SSO and OpenGraph. I have SSO working with
I am just starting out with Objective-C but have done a bunch of C++.
Just starting out with subversion, have set up repos for 3 current projects and
Just starting out, this should be a simple one but I haven't been able
I'm just starting out using Lua, and I was wondering (because I can't find
I'm just starting out with using Core Data on the iPhone SDK and I'm
I'm just starting out with Java, but my boss is pushing for this. I've
Just starting out with LINQ to SQL (you can probably tell - be gentle).
I am just starting out with iOS app development and it's been a great

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.