I have been integrating FacebookSDK with stack overflow and some tutorial, however it's not working properly for me. I cannot fetch profile data. This method is not even called. Only "complete login" appears. Login process is working but the log out option never appears on the button as it should be. I am thankful for any tips.

```
 import Foundation
 import UIKit
 import FBSDKLoginKit
 import FBSDKCoreKit

 class mainView: UIViewController, FBSDKLoginButtonDelegate {

@IBOutlet weak var navigationBar: UINavigationBar!
@IBOutlet weak var mainImage: UIImageView!
@IBOutlet weak var getRecipeBtn: UIButton!
@IBOutlet weak var addImageBtn: UIButton!

let loginButton: FBSDKLoginButton = {
    let button = FBSDKLoginButton()
    button.readPermissions = ["email"]
    return button
}()

override func viewDidLoad() {
     super.viewDidLoad()

    view.addSubview(loginButton)
    loginButton.center = view.center
    loginButton.delegate = self

    if let token = FBSDKAccessToken.current() {
        fetchProfile()
    }
}

func loginButton(_ loginButton: FBSDKLoginButton!, didCompleteWith result: FBSDKLoginManagerLoginResult!, error: Error!) {
    print("completed login")
}

func loginButtonWillLogin(_ loginButton: FBSDKLoginButton!) -> Bool {
    return true
}

func loginButtonDidLogOut(_ loginButton: FBSDKLoginButton!) {

}

func fetchProfile() {
    print("fetch profile")

    FBSDKGraphRequest(graphPath: "me", parameters: ["fields": "email, first_name, last_name, id"]).start(completionHandler:  { (connection, result, error) in guard

        let result = result as? NSDictionary,
        let email = result["email"] as? String,
        let user_name = result["fist_name"] as? String,
        let user_id = result["id"] as? String

            else {
                return
        }
        print(email)

       })
   }
}

```

*Here is my part of console log:(I have added fbauth to info.plist.)* 

RecipeMaster[19428:630625] -canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
 completed login

2017-02-08 22:48:23.308043 RecipeMaster[19428:640928] PAC Fetch failed with error [NSURLErrorDomain:-1003]

2017-02-08 22:48:23.308482 RecipeMaster[19428:641029] [] nw\_proxy\_resolver\_create\_parsed\_array PAC evaluation error: NSURLErrorDomain: -1003