I am trying to use Twitter Kit to authenticate with Twitter. However, the logIn method does not seem to call the completion block. Here is my code:
print("foo")
Twitter.sharedInstance().logIn(completion: { (session, error) in
print("bar")
if session != nil {
print("signed in as \(session!.userName)")
self.doStuff()
} else {
print("error: \(error.localizedDescription)")
}
})
foo is printing, so I know the code reaches that point. The login flow appears, and I sign in. However, bar is never printed, and neither is signed in as or error.
I am testing on a Simulator iPhone 8 running iOS 11 and have TwitterKit 3.2.1 installed through CocoaPods.