Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift iOS Twitter API Fails

Tags:

json

ios

twitter

I am trying to load some twitter feeds of a user on Swift iOS App. On twitter Documentation, I found the API is:

https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi&count=2

which returns:

{"errors":[{"message":"Bad Authentication data","code":215}]}

Older Rest API did not require. Newer API requires authentication.

Requires authentication? Yes

How do I get that working? Any tutorials would be even sweeter!

Before marking this question duplicate please bear in mind that I have done a good search and none of the answers answered my questions because a lot them point to older Rest APIs.

like image 698
tika Avatar asked Nov 10 '22 21:11

tika


1 Answers

Take a look at Twitter Fabric http://dev.twitter.com/fabric which is a free SDK (compatible with Swift) that provides easy authentication via either guest or user login. Sample app written in Swift at https://github.com/twitterdev/cannonball-ios

If you would prefer to use raw REST calls against the API, follow the OAuth details in our dev documentation https://dev.twitter.com/oauth

like image 144
Andy Piper Avatar answered Nov 14 '22 23:11

Andy Piper