4

I have been struggling with this following program execution which is currently I am doing in Xcode 8 and Swift 3...its just a simple login program but whenever the app runs the console simply prints the error "Could not successfully update network info during initialization" even before clicking the login button and the solutions are very less and none of them worked for me.

import UIKit
import FBSDKCoreKit
import FBSDKLoginKit
class ViewController: UIViewController, FBSDKLoginButtonDelegate {
    @IBOutlet weak var btnButton: FBSDKLoginButton!     
    override func viewDidLoad() {
     super.viewDidLoad()
                 // Do any additional setup after loading the view, typically from a nib.
    }
 override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
func loginButton(_ loginButton: FBSDKLoginButton!, didCompleteWith result: FBSDKLoginManagerLoginResult!, error: Error!)
        {
                if error == nil
                {
                   print("login Successful")
                   self.configureFacebook() 
                }
                else
                {
                    print("error\(error!)")
                }
               }
func loginButtonDidLogOut(_ loginButton: FBSDKLoginButton!)
        {
            let loginManager: FBSDKLoginManager = FBSDKLoginManager()
            loginManager.logOut()
            print("logout successful")    
        }
func configureFacebook()
        {
            btnButton.readPermissions = ["public_profile", "email", "user_friends"];
            btnButton.delegate = self         
    }
}
mokagio
  • 16,391
  • 3
  • 51
  • 58

0 Answers0