iostwitter

iOS pull user's Twitter feed (v1.1 api)


I've been struggling to migrate from Twitter v1 to v1.1 in my iOS application. What I need to do is probably the simplest thing, pull a specific twitter user's last 5 tweets. With v1 I just used the open API, but with v1.1 I need to authenticate. I don't want to have to rely on the iPhone user to have the universal login setup, so I've been researching Application Only Authentication.

Does anyone have an example of how to implement this on iOS? I've been reading the Twitter documentation here https://dev.twitter.com/docs/auth/application-only-auth and there aren't specific examples.


Solution

  • Check this library out

    https://github.com/nst/STTwitter

    One of the many methods the library has:

    - (void)getUserTimelineWithScreenName:(NSString *)screenName
                             successBlock:(void(^)(NSArray *statuses))successBlock
                               errorBlock:(void(^)(NSError *error))errorBlock;
    

    Oh, and it works with the new version of the API (1.1)