Saving Access Tokens (manual session creation)


#1

Our users log into our app using the traditional un/pw approach but have the option of linking their account with a Twitter account for easy shares. Is it possible to save their access tokens so that the next time they login I can automatically create a Twitter session for them without having them go through the authentication flow?

TWTRSession has a method that appears to offer this functionality: initWithSessionDictionary

But I cannot get it to work. I tried creating a dictionary using data from an existing session (authToken, authTokenSecret, userID, userName) but got the following error:

[TwitterKit] initWithAuthToken:authTokenSecret: Invalid parameter not satisfying: authToken


#2

I have encountered same issue. TWTRSession(sessionDictionary:) is useless without knowing the actual format of the dictionary.


#3

I meet same problem. How did you solve it. I want that a user login app, next time app shouldn’t ask allowing to information.


#4

This seems to be a very strange error.
Please go in Settings app, and check account on Twitter, you will see that account can’t connect to TW.
Delete and add again.
And will work.

Thanks


closed #5