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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:02:17+00:00 2026-06-16T21:02:17+00:00

My application supports login with facebook, but when I log out and log in

  • 0

My application supports login with facebook, but when I log out and log in again I am not asked for any credentials – it immediately logs in with the username which goes native in iOS6. I want something like in native facebook application:
When clicking "not you" facebook offers new login screen

When clicking “not you” facebook offers new login screen.

I followed this tutorial

The problem seems to be somewhere here:

- (void)openSession
{
    NSArray *permissions=[NSArray arrayWithObjects: @"publish_stream", @"publish_actions",@"create_event", nil];
   // [FBSession open]

    [FBSession openActiveSessionWithPublishPermissions:permissions
                                       defaultAudience:FBSessionDefaultAudienceEveryone
                                       allowLoginUI:YES
                                  completionHandler:
     ^(FBSession *session,
       FBSessionState state, NSError *error) {

         [self sessionStateChanged:session state:state error:error];
     }];
}


- (void)sessionStateChanged:(FBSession *)session
                      state:(FBSessionState) state
                      error:(NSError *)error
{
    switch (state) {
        case FBSessionStateOpen: {
            NSLog(@"Sesstion opened");
            UIViewController *topViewController =
            [self.navController topViewController];
            NSLog(@"Class: %@", [[topViewController presentedViewController] class]);
            if ([[topViewController presentedViewController]
                 isKindOfClass:[LoginViewController class]])
            {
                [topViewController dismissViewControllerAnimated:YES completion:nil];
            }

                ViewController *basic=(ViewController*)topViewController;
                NSLog(@"Populating details");
                [basic populateUserDetails];



        }
            break;
        case FBSessionStateClosed:
        {
            NSLog(@"Session closed");
            [FBSession.activeSession closeAndClearTokenInformation];

        }

        case FBSessionStateClosedLoginFailed:

            NSLog(@"Login failed");
            [self.navController popToRootViewControllerAnimated:NO];

            [FBSession.activeSession closeAndClearTokenInformation];

            [self showLoginView];
            break;
        default:
            break;
    }

    if (error) {
        UIAlertView *alertView = [[UIAlertView alloc]
                                  initWithTitle:@"Error"
                                  message:error.localizedDescription
                                  delegate:nil
                                  cancelButtonTitle:@"OK"
                                  otherButtonTitles:nil];
        [alertView show];
    }
}
  • 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-16T21:02:18+00:00Added an answer on June 16, 2026 at 9:02 pm

    I am not sure the Facebook SDK supports that – although I might be wrong. The idea (as I understand it) is that Facebook login allows the currently logged in Facebook user to login to your app. If no one is logged in to Facebook, the credentials page will be shown. After providing valid credentials, the user will be logged in to Facebook and an auth_token is sent to your app.

    The point is that you can’t authenticate a different user than the one currently logged in to Facebook. That would first require a logout of the current user and I think Facebook wish to keep this “change user” functionality to the Facebook app.

    Also, note that when logging out from your app, the user stays logged in to Facebook. This is different from the policy that applies to web sites that use Facebook authentication. In that case, the user should be logged out both from the site and from Facebook.

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

Sidebar

Related Questions

I am developing an application which on login page also supports facebook login with
I have a web application, where users have to login with their facebook accounts.
My application supports internationalization and localization, each user can choose his preference language and
By enable the option called Application supports iTunes file sharing , I can integrate
I have an application which supports multiple types and versions of some devices. It
I am creating an application that supports modules in the form of dlls that
I have a web application that supports a variety of clients on various platforms
I have created an IPAD application which supports on Portrait orientation. Before uploading on
I'm working on an application whihc supports using several DB vendors, with the table
I have written very very simple console application which supports some command line options.

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.