Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does TWRequest iOS API support application-only authentication?

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.

like image 731
Hisham Avatar asked Jun 13 '13 23:06

Hisham


1 Answers

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.

like image 196
nst Avatar answered Oct 06 '22 00:10

nst