TwitterKit, iOS - Custom setup of Twitter session


#1

Hi,

I’m using the TwitterKit to login using Twitter to my ios app. But I don’t always need to make login. Sometimes, I already have session data (token, secret, user name and userId). Is there a way to configure the TwitterKit shared instance with Twitter session (and prevent from doing an unnecessary login).

Two examples for such scenario:

  1. Switch users feature: If the user choose to switch between two Twitter users, we logging out from the current user and then trying to login to a different user. If the second login has failed, I want to re-login with the previous user and not to be on a logout state.
  2. Using the Parse.com API: Parse is saving the Auth data on server. If user make a login with user which connected with Twitter account also, I want to be able to setup the TwitterKit with the session currently saved on the server

Thanks


#2

Hey there,

I believe you can do this by passing a dictionary to initWithSessionDictionary

Take a look at https://dev.twitter.com/twitter-kit/ios-reference/twtrsession

V


#3