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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:13:48+00:00 2026-06-05T10:13:48+00:00

On [self.facebook requestWithGraphPath:@me andDelegate:self]; I get the above mentioned exception. Here is my code

  • 0

On [self.facebook requestWithGraphPath:@”me” andDelegate:self]; I get the above mentioned exception. Here is my code

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.facebook = [[Facebook alloc] initWithAppId:@"<app id hidden>" andDelegate:self];

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

    if (![self.facebook isSessionValid]) {

        NSArray *permissions = [[NSArray alloc] initWithObjects:
                                @"user_likes", 
                                @"read_mailbox",
                                nil];
        [self.facebook authorize:permissions];

        [self.facebook requestWithGraphPath:@"me" andDelegate:self];

    }




}

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {

    return [self.facebook handleOpenURL:url]; 
}

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



}
-(void)request:(FBRequest *)request didLoad:(id)result
{
    NSArray *messagesResult= result;
}
-(void) request:(FBRequest *)request didFailWithError:(NSError *)error
{
    NSLog(@"%@",error);
}
  • 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-05T10:13:50+00:00Added an answer on June 5, 2026 at 10:13 am

    You should wait for Facebook to authorize you and call fbDidLogin in your FB delegate. Then, in fbDidLogin you launch requestWithGraphPath:. In your code you launch graph request before token is received, because FB authorization is asyncronous.

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

Sidebar

Related Questions

In my ViewController - (IBAction)loginBtn:(id)sender { facebook = [[Facebook alloc] initWithAppId:@231190276934148 andDelegate:self]; NSUserDefaults *defaults
I have all the list of friends which I get using [facebook requestWithGraphPath:@me/friends andDelegate:self];.
I am trying to get data of my Facebook photos using: [self.facebook requestWithGraphPath:@me/photos andDelegate:self]
Using the Graph Facebook API with this code [facebook requestWithGraphPath:@me/friends andDelegate:self]; Now I have
- (id)init { if (self == [super init]) { facebook = [[Facebook alloc] initWithAppId:kAppId];
In my iOS app, I get an access token using the following code: [self.facebook
In Facebook iOS SDK, I can ask for queries like this: [_facebook requestWithGraphPath:@me/feed andDelegate:self];
[facebook requestWithGraphPath:@me/home andParams:params andDelegate:self]; and I got result like these: =========================================== id: 619421723284_367295343463689, from:
First i create facebook object with my appId: facebook = [[Facebook alloc] initWithAppId:kAppId]; When
After _facebook = [[Facebook alloc] init]; and [_facebook authorize:kAppId permissions:_permissions delegate:self]; How can I

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.