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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With