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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:10:58+00:00 2026-05-31T00:10:58+00:00

i need to use the facebook api: in the appdelegate.m I have this code:

  • 0

i need to use the facebook api:
in the appdelegate.m I have this code:

// Initialize Facebook
facebook = [[Facebook alloc] initWithAppId:@"MY_TOKEN" andDelegate:self];

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

after, in another view I have this:

AppDelegate* dlg = (AppDelegate *)[[UIApplication sharedApplication] delegate];
NSArray *permissions = [[NSArray alloc] initWithObjects:@"offline_access", nil];

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

and works fine: call safari with the authorization to use my app, I click Ok to authorize and my app is called again… my app visualize the last view before the authorize, but the event

- (void)fbDidLogin
{
    NSLog(@"fbDidLogin");
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"];
    [defaults setObject:[facebook expirationDate] forKey:@"FBExpirationDateKey"];
    [defaults synchronize];
}

in AppDelegate.m (my appdelegate have FBSessionDelegate) is not fired (also the other events of FBSessionDelegate like fbDidNotLogin are not fired…

where is my error?
thanks in advance

  • 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-31T00:10:59+00:00Added an answer on May 31, 2026 at 12:10 am

    I think you forgot about this two methods and perhaps forgot to add your Facebook app id to URL types in info file. for more detail

    // Pre 4.2 support

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

    // For 4.2+ support

    - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
        sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
        return [facebook handleOpenURL:url]; 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Android 2.2 project that I need to use the facebook api
Need help. I have Graph API code that uses an auth token with offline
Can someone point me to Objective-C facebook API. I need to use it for
Hi i need to use https://api.facebook.com/method/fql.query?query= to get user profile picture and other user
Need to use own imaged markers instead built-in pins. I have several questions. 1.
I am trying to use the new facebook api and it requires libcurl PHP.
From what I understand if I need to make request to facebook API I
Due to Facebook api restrictions for iOS, I need to be able to send
I almost have facebook connect working the way I need it on my site,
I'm working through the Facebook API for my iPhone app, and have two questions:

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.