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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:07:14+00:00 2026-06-12T14:07:14+00:00

The documentation for the new Facebook SDK 3.0 tells us this: In some cases,

  • 0

The documentation for the new Facebook SDK 3.0 tells us this:

“In some cases, the iOS device won’t have an access token for a user who has already connected an app to their Facebook account. This can happen when a user used an app’s website or used the app on another mobile device. To use the iOS 6 native Auth Dialog, apps need to ‘import’ the user’s credentials into the device and need to show the iOS 6 native Auth Dialog.”

(see http://developers.facebook.com/docs/howtos/ios-6/, tip 2)

I’d like to know how to import this data, I can’t find a code example.

Thanks,

Tim

P.S. For information (and testing purposes) it’s easy to reproduce the above situation in an app:

  1. In the settings app, delete the Facebook account
  2. In the app under development connect to Facebook via SSO, (it should fall back to this given that there’s no Facebook account registered under iOS6
  3. Set up the Facebook account again in the settings app
  4. Once again, try signing in via the app under developement. This time it will still access Facebook via SSO since the token was created using it.
  • 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-12T14:07:15+00:00Added an answer on June 12, 2026 at 2:07 pm

    As MrNickBarker suggested the solution is to log the user out of SSO. However, I only wanted to do this if I was absolutely sure that in doing so they user would be logged back in via the iOS 6 authentication system.

    My problem was that I didn’t know of a way of ensuring that the user was logged into Facebook via the Settings app, and I didn’t want to log the user out of Facebook only to have them send back to the Facebook app for an SSO login each and every time.

    None of the ACAccountStore methods will tell you if the user has entered their Facebook details into the Settings app, hwoever I finally discovered [SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook] which does exactly this.

    Here then is the solution:

    ACAccountStore *accountStore = [[NSClassFromString(@"ACAccountStore") alloc] init];
    ACAccountType *accountType;
    if (accountStore &&
        (accountType = [accountStore accountTypeWithAccountTypeIdentifier:@"com.apple.facebook"]) &&
        [SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
    {
        // There's an account store and it knows about Facebook - we must be on iOS 6 or higher.
        //
        // [SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook] also tells us that
        // the user has signed into their Faecbook account via the Settings app.
        //
        // At this point there could be a valid session that's been previously created via SSO prior to the
        // user signing into Facebook from Settings.app. In this case, calling openActiveSessionWithReadPermissions:
        // will continue to log on using SSO rather than the preferred route of using the built in iOS support.
        //
        // [accountStore accountsWithAccountType:accountType] will return an account for this application once
        // it's been used to log into Facebook. Clearly, if there is an account returned then the then we don't want to
        // force a logout.
        //
        // On the other hand, if no accounts are returned then we can safely call closeAndClearTokenInformation
        // in order to clear any SSO tokens, thereby ensuring that the next login will attempt to use the iOS
        // authentication (which we can do since the user has signed into the Settings app).
    
        if ([[accountStore accountsWithAccountType:accountType] count] == 0)
            [FBSession.activeSession closeAndClearTokenInformation];
    
        // Try to connect with read permissions only (as required for iOS auth)
    
        _usingiOSIntegratedLogin = YES;
        [FBSession openActiveSessionWithReadPermissions:nil
                                           allowLoginUI:YES
                                      completionHandler:completionHandler];
    }
    else
    {
        // Either this is < iOS 6, or there's no Facebook account registered - request both
        // read and write permissions in order to avoid two trips to the Facebook app or web view
    
        _usingiOSIntegratedLogin = NO;
    
        NSMutableArray *permissions = [NSMutableArray arrayWithArray:[self publishPermissions]];
        [permissions insertObject:@"user_photos" atIndex:0];
    
        [FBSession openActiveSessionWithPermissions:permissions
                                       allowLoginUI:YES
                                  completionHandler:completionHandler];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to this Facebook coding game so have stumbled upon a fault
hello im new to python and have been reading over the documentation and am
I am new to modernizr. I read some documentation on modernizr, and I wanted
I am new to OSX user space development. I've read documentation and googled before
I am fairly new to Git and trying my best to find some documentation
Im just starting out with the Facebook SDK for iOS and checked out the
I'm posting some info to a user's wall via Facebook Connect (from my external
According to the Facebook Documentation all I have to do is add a picture
curl -F 'access_token=...' \ -F 'message=Hello, Arjun. I like this new API.' \ https://graph.facebook.com/arjun/feed
In my current .NET and FBML-based facebook app, I have some code that looks

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.