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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:15:51+00:00 2026-06-10T01:15:51+00:00

I followed the Facebook SDK tutorial from Facebook step by step. I have everything

  • 0

I followed the Facebook SDK tutorial from Facebook step by step. I have everything working besides fbDidLogin getting called… the authorization process works fine. I’ve been told to do:

     - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
          return [[controller facebook] handleOpenURL:url];
     }

from fbDidLogin not called

the problem is is that I’m not exactly sure how to alloc init my view controller. Here is my .h for app delegate:

#import <UIKit/UIKit.h>
#import "FBConnect.h"


@interface fb2AppDelegate : UIResponder  <UIApplicationDelegate, FBSessionDelegate> {

    Facebook *facebook; 
    UIViewController *fb2ViewController;
}

@property (strong, nonatomic) UIWindow *window;
@property (strong,nonatomic) Facebook *facebook; 
@property (nonatomic, strong) UIViewController *fb2ViewController;

@end

and the .m :

#import "fb2AppDelegate.h"

@implementation fb2AppDelegate
@synthesize window = _window;
@synthesize facebook;
@synthesize fb2ViewController;


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    self.fb2ViewController = [[UIViewController alloc] init];

    facebook = [[Facebook alloc] initWithAppId:@"key_here" andDelegate:self];


    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    if ([defaults objectForKey:@"FBAccessTokenKey"] 
        && [defaults objectForKey:@"FBExpirationDateKey"]) {
        facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
        facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
    }

    if (![facebook isSessionValid]) {
        [facebook authorize:nil];
    } 


    return YES;
}


- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
    return [[fb2ViewController facebook] handleOpenURL:url];
}


- (void)fbDidLogin {

    NSLog(@"fbdidlogin"); 

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"];
    [defaults setObject:[facebook expirationDate] forKey:@"FBExpirationDateKey"];
    [defaults synchronize];

    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   @"key_here", @"app_id",
                                   @"http://developers.facebook.com/docs/reference/dialogs/", @"link",
                                   @"http://fbrell.com/f8.jpg", @"picture",
                                   @"Facebook Dialogs", @"name",
                                   @"Reference Documentation", @"caption",
                                   @"Using Dialogs to interact with users.", @"description",
                                   nil];

    [facebook dialog:@"feed" andParams:params andDelegate:self];

}

as for the view controllers… I haven’t put any code in them.

the error that I am receiving is:

no visible @interface for ‘UIViewController’ declares the selector ‘Facebook’

what am i doing wrong?

thx!

  • 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-10T01:15:52+00:00Added an answer on June 10, 2026 at 1:15 am

    Okay, You need to do:

    [facebook handleOpenURL:url]. 
    

    You are currently using facebook as a selector instead of an object.

    Also.. you need to set facebook.sessionDelegate = self, so that the delegate method fbDidLogin can get called.

    Hope this helps!

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

Sidebar

Related Questions

I followed this tutorial here: http://www.dannyherran.com/2011/02/facebook-php-sdk-and-codeigniter-for-basic-user-authentication/ It works great but when I enable CSRF
So i followed this tutorial to set up the android facebook sdk in my
I have followed the facebook developer tutorial in order to do this to no
After loading the Facebook C# SDK (FacebookWebMVC) library from NuGet, I followed exactly the
I have tried using the CSWPFSimpleApp from the Facebook C# SDK for a couple
I have followed the Facebook PHP SDK example and created the following. <?php require
I've followed the instructions on http://developers.facebook.com/docs/api#authorization using the standard PHP library. Everything works fine
I have followed this tutorial which uses jQuery UI to generate Facebook tokens like:
I followed this tutorial to implement facebook into my application. All I want is
I am using Zend_Framework's Zend_Controller_Action to build a facebook application. I followed the step

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.