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];
}];
}
}