Creating a Facebook Login Based App

Free71 reads

Question

 

Create a Facebook login based app.
App should have 3, not necesary, view controllers.
1- welcome screen with a button to connect using facebook.
2- the facebook button and a button to go back to the main page.
3- theviewcontroller that will show up as the login went successful.

How can redirect the user to another window after login went ok?

This the code in the viewController.swift file

importUIKit

importFBSDKLoginKit //my Code

importFBSDKCoreKit //my Code

classViewController: UIViewController{

overridefuncviewDidLoad() {

super.viewDidLoad()

letlogInButton = FBSDKLoginButton()

view.addSubview(logInButton)

logInButton.center = view.center

if (FBSDKAccessToken.current() != nil) {

// User is already logged in, do work such as go to next view controller.

// I need help here. How to send the user to another window.

}

}

overridefuncdidReceiveMemoryWarning() {

super.didReceiveMemoryWarning()

// Dispose of any resources that can be recreated.

}

}

Everything works like it should, I just help redirecting the user to "Show after successful login" after login with Facebook happens
Right now it only shows the Facebook logout button and stays in the same page...

Show transcribed image text

 

Answer

 

Drop an email to support@thereliabletutor.com and get instant access to the solution.

Download Free Solution