TWTRTwitter.sharedInstance().sessionStore.session() alway return nil


#1

here is my code to login twitter and go customized post method.
but TWTRTwitter.sharedInstance().sessionStore.session() alway return nil.
TWTRTwitter.sharedInstance().sessionStore.hasLoggedInUsers() returns “YES”(true).

what is wrong ?

    @IBAction func tapBtn(_ sender: UIButton) {
        let isLogin = TWTRTwitter.sharedInstance().sessionStore.hasLoggedInUsers()
        print("isLogin : \(isLogin ? "YES" : "NO")")
        let session = TWTRTwitter.sharedInstance().sessionStore.session() as? TWTRSession
        print("session : \(String(describing: session))")
        if session != nil {
            // POST METHOD HERE
        } else {
            TWTRTwitter.sharedInstance().logIn { (session, error) in
                if (session != nil) {
                                                   self.tapBtn(sender)
                                           }
                    })
                } else {
                    print("error: \(String(describing: error?.localizedDescription))");
                }
            }
        }
    }

#2

Hi @RizaSTAR,

this worked properly in the previous version of the SDK.

Unfortunately I think this is what’s wrong: https://github.com/twitter/twitter-kit-ios/issues/58

Let’s just hope for the best.