5

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.

tika
  • 7,135
  • 3
  • 51
  • 82

2 Answers2

1

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

Andy Piper
  • 11,422
  • 2
  • 26
  • 49
0

In settings of your simulator go to accounts -> Twitter, and login there in actual twitter account. As you try to login, it doesn't know what user to use, so you need to specify it.

IosDev_123
  • 36
  • 8