0

I'm trying to make my user login using Facebook. If they are not logged in, my app brings up an overlay view that forces the user to login. This is how I do that:

    self.overlay.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height)

    loginButton.readPermissions = ["public_profile", "email", "user_friends"]
    self.loginButton.delegate = self
    self.loginButton.center = self.overlay.center
    self.overlay.addSubview(self.loginButton)

    UIApplication.shared.keyWindow?.addSubview(overlay)

The login button shows up and covers the whole screen, which is exactly what I want, but then once the user clicks on the login button, it doesn't bring up the login page as expected. I believe this is because the overlay is covering it. The console prints this error:

"canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"

2017-12-03 17:05:02.683700-0800 FinalProject[3093:58095]" I'm completely stumped here. Not sure if it's relevant, but this is within a TableViewController.

Thanks!

Megan Wood
  • 3
  • 1
  • 5

1 Answers1

0

It seems like you have to enable Keychain Sharing. Follow instructions on this post: https://stackoverflow.com/a/40191999/3692511

Appfred
  • 103
  • 7