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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:56:09+00:00 2026-06-15T20:56:09+00:00

I have an app that still uses the deprecated Facebook class to connect with

  • 0

I have an app that still uses the deprecated Facebook class to connect with Facebook. If I authorize with no extended permissions, everything works fine. But if I do include permissions, the first round trip to authorize always fails (even though it gets a valid token!). Am I missing a step?

Here’s the code to initiate Facebook authorization for the app

- (IBAction) doConnect:(id)sender
{
    NSArray* permissions = [NSArray arrayWithObjects:
                            @"email",@"publish_actions",nil];
    [self.facebook authorize:permissions];
}

Here’s the code that gets invoked after the user has granted permissions and control returns to my app. The url always includes a nice looking token, even the first time through.

// handle the incoming url from app switching
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    return [self.facebook handleOpenURL:url];
}

And here’s the FBSessionDelegate method that gets invoked after a successful connect. Even though the url above contained a token, it’s gone the first time we get here. But if I invoke the doConnect method above, the token will be present when we get here.

// FBSessionDelegate
- (void)fbDidLogin
{
    if( [self.facebook accessToken] == nil )
    {
        NSLog(@"Had an access token above, but not now!");

        // If I reinvade the doConnect: method again, it will work!!!
    }
    // ...

}

Looking deep in the sdk code in FBSession.m, it seems that the requested permissions haven’t been associated with the new token first time through, causing the session to ignore the new token. First time through, cachedPermissions is always an empty list

    // get the cached permissions, and do a subset check
    NSArray *cachedPermissions = [tokenInfo objectForKey:FBTokenInformationPermissionsKey];
    BOOL isSubset = [FBSession areRequiredPermissions:permissions
                                 aSubsetOfPermissions:cachedPermissions];
  • 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-15T20:56:11+00:00Added an answer on June 15, 2026 at 8:56 pm

    You are asking for two types of permissions, a read type (email) and a write type (publish_actions).

    You should be using the latest Facebook SDK, v3.1.1 and you’ll have to split up read and writes separately – especially if you wish to support iOS6. You can only ask for reads initially. See the note in https://developers.facebook.com/docs/tutorial/iossdk/upgrading-from-3.0-to-3.1/ and the section on asking for read and writes separately.

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

Sidebar

Related Questions

I have a phonegap app that uses jqm that works fine in android and
I have an App that downloads and displays images from URL's. This works fine
We have a mish-mash app with a legacy module that still uses DataSets, DataViews
I have accomplished developing an android app that uses the facebook sdk to integrate
I have an app that uses a Class with an extension SurfaceView to draw
I have an app that successfully uses Facebook's single sign on to log a
I have an app that uses the ActionBar with tabs in combination with Fragments.
I have an app that uses Apples reachability code. When I tab out of
INITIAL QUESTION: I have an app that uses ExecutorService to run 4 fixedThreadPool. When
I have a small app that a client uses to manually update some data.

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.