Does TWRequest iOS API support application-only authentication?
Asked Answered
P

2

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.

Perigee answered 13/6, 2013 at 23:0 Comment(0)
M
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.

Maroc answered 2/10, 2013 at 7:57 Comment(0)
R
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.

Raoul answered 22/7, 2013 at 9:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.