0

i am very new to iOS app with Xcode. i have made an iOS app that has a Facebook integration (Facebook login) to authenticate the user and user can only get into my app after successful login but in my case after successful login ,the control goes back to my login with Facebook page(view controller) rather than get into my app home page (view controller) so please suggest me what to do to get into my app home page after login.

for your knowledge, i am using storyboard and plain view controller files rather than navigation controller and my app is not uploaded on app store yet, it is in a development phase right now. thanks in advance.

  • Observe an `NSNotification` sent by your app delegate and react accordingly by pushing your menu controller. [This answer](http://stackoverflow.com/questions/25459925/integrating-two-login-system-into-an-app/25460458#25460458) may help you – rebello95 Nov 19 '14 at 05:51

1 Answers1

0

You can use the delegate method

 - (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
                                user:(id<FBGraphUser>)user {
        [self performSegueWithIdentifier:@"yourSegueToDestinationViewController" sender:self];
    }

This should achieve you the desired results. Remember to check for errors. You should not perform segue if you are not given permissions by the user.

Krishna
  • 770
  • 2
  • 8
  • 21
  • @krisha -- r u sure the redirect page should not come in the same page – Anbu.Karthik Nov 19 '14 at 05:58
  • Please elaborate what do you mean by same page? You need to add this code to the same viewcontroller where you have login button for facebook. Remeber facebook will redirect you to the same viewcontroller from where facebook permission page was invoked. – Krishna Nov 19 '14 at 06:03
  • thank you for helping me.this works for me and sorry for commenting too late. but there is one more problem occured – ALANKRITA SHARMA Nov 20 '14 at 11:25
  • thank you for helping me.this works for me and sorry for commenting too late. but there is one more problem occurred.it takes me my home page (view controller) but after viewing the login page for a second and i didn't want to show login page.and also on my home page when i click on logout button i want it takes eon login page but this is not working even performing segue like this: - (void)loginViewShowingLoggedOutUser:(FBLoginView *)loginView { [self performSegueWithIdentifier:@"back_authentication" sender:self]; } please help me on this. – ALANKRITA SHARMA Nov 20 '14 at 11:34