0

I've been trying to add the Facebook login feature to my app and I've successfully embeded it however, whenever I click on the Facebook button it opens the browser with the login page, I was wondering if anyone knows how to do this without opening the browser and just have it load in the current view.

- (void) facebookAction
{

    if (FBSession.activeSession.state == FBSessionStateOpen
        || FBSession.activeSession.state == FBSessionStateOpenTokenExtended) {

        [FBSession.activeSession closeAndClearTokenInformation];

    } else {
        [FBSession openActiveSessionWithReadPermissions:@[@"public_profile", @"user_birthday", @"email"]
                                       allowLoginUI:YES
                                  completionHandler:
     ^(FBSession *session, FBSessionState state, NSError *error) {

         // Retrieve the app delegate
         AppDelegate* appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
         // Call the app delegate's sessionStateChanged:state:error method to handle session state changes
         [appDelegate sessionStateChanged:session state:state error:error];

         self.fbSession = session;

         ProcessData *processData = [[ProcessData alloc] initWithDelegate:self];
         [processData loginWithFacebook:session.accessTokenData.accessToken];
     }];
    }
}
rmaddy
  • 307,833
  • 40
  • 508
  • 550
Mikerizzo
  • 587
  • 1
  • 4
  • 22
  • 1
    Check [this](http://stackoverflow.com/questions/17023059/integrating-facebook-sdk-in-ios/17023588#17023588) to know about different login flows. http://stackoverflow.com/questions/17023059/integrating-facebook-sdk-in-ios/17023588#17023588 – Anil Varghese Jun 03 '14 at 13:10
  • @Anil thanks, got exactly what I needed. – Mikerizzo Jun 03 '14 at 17:29

0 Answers0