Ios TwitterKit + Parse Can Not Log in Twitter User ( from Parse Session)

ios

#1

So I use parse to login and signup users via Twitter from my ios app. Twitter signup works as intended from Parse but when trying to log in the user into TwitterKit (so that I can post tweets ) the TWTRAuthSession == nil.

This is the solution I’m following: http://stackoverflow.com/a/32634161/150608 What may be the issue?

  let authToken = PFTwitterUtils.twitter()?.authToken
  let authTokenSecret = PFTwitterUtils.twitter()?.authTokenSecret

Twitter.sharedInstance().sessionStore.saveSessionWithAuthToken(authToken!, authTokenSecret: authTokenSecret!, completion: { (session, error) -> Void in

Session is always nil. I have checked and I have an authToken and authTokenSecret.


#2

Have you called

Twitter.sharedInstance().start(withConsumerKey: key, consumerSecret: secret)

in your AppDelegate.swift?


#3

wow such a simple oversight but that was the fix thanks!


#4

How long does twitter “keep” the session before needing to revalidate?


#5

User sessions don’t expire unless they are invalidated by the user.