0

An active accesstoken is available, but I am still getting an error while using the latest Facebook SDK like

code = 2500;
message = "An active access token must be used to query information about the current user.";

Below is the code I am using.

if (!appDelegate.session.isOpen) 
{
    appDelegate.session = [[FBSession alloc] initWithPermissions:[NSArray arrayWithObject:@"status_update"]];
    NSLog(@"Access Token Available == %@", appDelegate.session.accessTokenData.accessToken);

    [FBRequestConnection startWithGraphPath:[NSString stringWithFormat:@"me/feed"] parameters:[NSDictionary dictionaryWithObjectsAndKeys:@"Testing from iOS", @"description",@"Testing FB Status Update", @"message", nil] HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error){
        if(error)
        {
           NSLog(@"Error = %@", error);
        }
        else
           NSLog(@"Posted !");

    }];
}

What is the actual problem...?

Thanks

specios
  • 25
  • 8

2 Answers2

0

In the parameter list add access_token parameter too.

You can also verify the access token here: http://developers.facebook.com/tools/debug

Sahil Mittal
  • 20,697
  • 12
  • 65
  • 90
0

I reckon you don't have the permission granted for the query. Have the user allowed the app to get the info you are trying? Try out the tools on the developers.facebook.com. Very useful to debug the API.

curly_brackets
  • 5,491
  • 15
  • 58
  • 102