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 6224157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:37:23+00:00 2026-05-24T08:37:23+00:00

this is my first time posting as I usually just come by to do

  • 0

this is my first time posting as I usually just come by to do research for issues, but this one I cannot figure out myself.

Basically my problem is similar to other developers using the facebook sdk for iOS, my fbDidLogin function never gets called even after I log in and can make my posts to feed successfully. I looked at the other threads here such as fbDidLogin never called (facebook-ios-sdk) and fbDidLogin not called, however I haven’t been successful. My app has a main view that is loaded and upon button press it pulls in the second nib and replaces the view. That second view controller has the facebook functionality in there, and I feel like my issue might be connecting from the Appdelegate to that secondViewController. I noticed in the sample app that everything is set up in the appdelegate but that is not the way my program functions.

I’m new to objective c programming but I’ve been fine in terms of building some apps so far, just this facebook sdk is killing me.

I appreciate any direction people could throw at me. Thank you.

Here’s some of the code:

- (void)login {
    facebook=[[Facebook alloc]initWithAppId:FB_APP_ID];
    NSLog(@"Inside login/post to wall function.");
    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                       @"mystuff",@"test",
                                       @"mystuff", @"link",
                                       @"mystuff", @"picture",
                                       mystuff, @"name",
                                       @"mystuff", @"caption",
                                       @"mystuff", @"description",
                                       @"mystuff",  @"message",
                                       nil];
    [facebook dialog:@"feed" andParams:params andDelegate:self];
}

/**
 * Invalidate the access token and clear the cookie.
 */
- (void)logout {
    [facebook logout:self];
}

/**
 * Called when the user has logged in successfully.
 */
-(void)fbDidLogin{
    NSLog(@"Inside fbDidLogin function.");
}

/**
 * Called when the user canceled the authorization dialog.
 */
-(void)fbDidNotLogin:(BOOL)cancelled {
    NSLog(@"User did not login.");
}
  • 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-05-24T08:37:23+00:00Added an answer on May 24, 2026 at 8:37 am

    The issue here is that your delegate isn’t around anymore once the authorization process completes. I would create a class that implements FBSessionDelegate and keep it as a property on your application delegate. Now, when you wire up the delegate, set it to that property. You can also wire this up using interface builder if you would like. Simply set the delegate to that property that you defined on the app delegate.

    For example, you could have a class that does the following (this code covers 80% of it – hopefully it gets you on the right track):

    typedef void (^completionHandler)(id);
    
    @interface FacebookController : NSObject <FBSessionDelegate>
    {
        completionHandler handler;
    }
    
    - (void)postToWallWithOptions:(NSDictionary *)options;
    - (void)login:(completionHandler)handler;
    - (void)fbDidLogin;
    

    And the implementation would be:

    @implementation FacebookController
    
    - (void)postToWallWithOptions:(NSDictionary *)options
    {
        completionHandler handler = ^(id data)
            {
        // If you want this class to also be the delegate dialog, it will need to implement FBDialogDelegate
                [facebook dialog:@"feed"
                       andParams:options
                     andDelegate:self];
            };
    [self login:handler];
    }
    
    - (void)login:(completionHandler)handler
    {
    completionHandler = handler;
    // Be sure to add in your permissions here
    [facebook authorize:yourPermissions 
                   delegate:self];
    }
    
    - (void)fbDidLogin
    {
    // You could pass any object you needed to here
    completionHandler(nil);
    }
    
    @end
    

    You would need to define this class as a property on your application delegate:

    @property (nonatomic, retain) FacebookController *fbController;
    

    Now, whenever you need your FacebookController, you simply can do this:

    FacebookController *fbController = [(MyAppDelegate *)[[UIApplication sharedApplication] delegate] fbController];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first time posting -- I found similar issues but not anything
use this website a lot but first time posting. My program creates a number
Hey guys, this is my first time actually posting at stackflow but i've used
This is my first time posting to stackoverflow, but these threads have helped me
This is my first time posting here, but I've found a lot of answers
this is my first time posting here, but I didn't know where else to
This is my first time posting on Stackoverflow, but I've been reading through many
first time posting here, but god know's I use this site to search for
this is my first time posting here, I have a question which I have
this is my first time posting on here and have read alot of helpful

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.