6

If iOS user has no twitter accounts, is it possible to use application-only authentication via TWRequest for apis like getting a user's timeline? (user_timeline.json)?

I am currently getting http status 400 with the user_timeline.json API when there are no twitter accounts setup on the iOS device.

stitz
  • 1,429
  • 1
  • 16
  • 33
Hisham
  • 1,305
  • 2
  • 15
  • 25

2 Answers2

1

You cannot use TWRequest directly since TWRequest requires an instance of ACAccount. This acAccount is optional according to documentation and Apple implementation could totally have handled the app-only flow when acAccount is nil, but unfortunately it's not the case.

Nevertheless, you can use the STTwitter library to retrieve a user timeline without user's context.

Code snippet here.

nst
  • 3,862
  • 1
  • 31
  • 40
0

Look at this answer: iOS Twitter User-Timeline fetching with v1.1 API

Anyway, since iOS 5 and Twitter REST API v1.1 things became quite complicated to retrieve any information from a device without using an account.

My solution was to add a UIWebView (instead of the ideal UITableView). And then developed a PHP website (a table with tweets) retrieving the timeline information from Twitter to my server.

Community
  • 1
  • 1
enricmacias
  • 142
  • 2
  • 9