Friday, 15 April 2011

objective c - How to make Facebook Login Button segue to alternate View Controller -


So I'm trying to include a Facebook login screen before a tabbar controller. What I've done so far is a visual controller that first shows the "Login on Facebook" button. Once clicked, it takes you to the device or to facebook.com. You enter your information, click on login, and it takes you to the same view controller, which I now show the user profile picture, name, email and a logout button. What do I want to do want , once you enter through the Facebook app or website, it takes you to a second view controller, in my case, a tabbar controller is the simplest steps In:

  1. Click the "Log in to Facebook" button.
  2. To launch the screen once, enter your information.
  3. The app now enters a TabBarController, which is the main home page of the application that I am making.

Setup is currently pulled by the "strong" FBLoginView Facebook SDK with the custom class of a UIView controller, "Button" in the way Once you enter your login information and click Login, I just need this "button" to join my "TabBre Controller"

FYI : The code I am using is a setup that Facebook gives when you use the tutorial to login to Facebook in the app. Below is My LoginViewControoler.m

  #import "LoginViewController.h" @Interface Log VVVController () @end @implementation LoginViewController - (zero) viewDidLoad {[super viewDidLoad]; // Setup an additional after loading the scene Self.loginButton.delegate = self; [Self-tooldheardstate: yes]; Self.lblLoginStatus.text = @ ""; Self.loginButton.readPermissions = @ [@ "public_profile", @ "email", @ "user-friend"]; } - (zero) loginViewShowingLoggedInUser: (FBLoginView *) Login view {self.lblLoginStatus.text = @ "You are logged in."; [Self-Toldhystestate: NO]; } - (zero) loginViewFetchedUserInfo: (FBLoginView *) login user: (id & lt; FBGraphUser & gt;) user {NSLog (@ "% @", user); Self.profilePicture.profileID = user.objectID; Self.lblUsername.text = user.name; Self.lblEmail.text = [User ObjectFor: @ "email"]; } - (Zero) LoginViewing logon user: (FBOGIN view *) Loginview {self.lblLoginStatus.text = @ ""; [Self-tooldheardstate: yes]; } - (zero) login view: (FBLoginView *) loginwall handle error: (nserror *) error {nslog (@ "% @", [error localized description]); } - (toggleHiddenState: should be touched by BOOL) {self.lblUsername.hidden = shouldhide; Self.lblEmail.hidden = shouldhide; Self.profilePicture.hidden = shouldhide; } - (void) has received a Memoriarning {[super Ddraeswimamomi warning]; // Any resource settlement which can be reproduced } / * #pragma mark-navigation // In a storyboard-based application, you often want to prepare a bit before navigation - (zero) Prepare ForSegue: Sender Sender (ID) from (UIStoryboardSegue *): Using the new view controller [segue destinationViewController]. // pass the selected object to the new view controller} * / /end  

which By the way I know how to do this, it has to enter the button on a modal view controller that automatically submits at startup (in the visualdial load of the initial view controller) then it is rejected at the end of a successful login end or with the rejected button Does.


No comments:

Post a Comment