ios - How to pass auth token from Parse SDK to Fabric TwitterKit? -


i log in twitter users using +[pftwitterutils loginwithblock:] method parse sdk. user profile picture login second time -[twitter loginwithcompletion:] method fabric twitterkit. there way pass auth token parse sdk twitterkit , login once?

there way export auth token , auth token secret parse using pf_twitter class parse sdk. looks should possible create twitterkit session using -[twtrsession initwithsessiondictionary:], twitter docs says nothing dictionary format , can't working.

parse

when user logged in using parse's twitterutils method called twitter. right i'm using swift, pftwitterutils.twitter() you'll data needed. guess should [pftwitterutils twitter]; in objective-c.

the class pf_twitter on parse.

fabric twitterkit

once object you'll access authtoken , authtokensecret current user. gotta use method twitterkit (note: deprecated in future, @ update @ bottom):

objective-c:

[twitter sharedinstance]

loginwithexistingauthtoken:authtokensecret:completion:

swift:

twitter.sharedinstance().loginwithexistingauthtoken(authtoken, authtokensecret: authtokensecret, completion: { (session, error) -> void in }) 

if went well, return current session.

documentation:

parse:

https://parse.com/docs/ios/api/classes/pftwitterutils.html#//api/name/twitter

pf_twitter - https://parse.com/docs/ios/api/classes/pf_twitter.html

fabric:

https://docs.fabric.io/appledocs/twitter/classes/twitter.html#//api/name/loginwithexistingauthtoken:authtokensecret:completion:

update:

i noticed loginwithexistingauthtoken deprecated. best way using twtrsessionstore's savesessionwithauthtoken method:

twitter.sharedinstance().sessionstore.savesessionwithauthtoken(authtoken, authtokensecret: authtokensecret, completion: { (session, error) -> void in                      }) 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -