Search code examples
iphoneobjective-ciostwittermgtwitterengine

Twitter API for iPhone?


I want to integrate my app with twitter. I need to show tweets containing certain hashtags or from a particular user.

I tried MGTwitterEngine+xOAuth, but i want twitter tweets only so no need of authentication required. MGTwitterEngine+xOAuth needs authentication so any API or method to get tweets certain hashtags or from a particular user.


Solution

  • you are right, you don't neeed xOAth to make a search according to twitter search API. If you want to use MGTwitterEngine you can use one of those methods :

    // Search method
    
    - (NSString *)getSearchResultsForQuery:(NSString *)query;
    - (NSString *)getSearchResultsForQuery:(NSString *)query sinceID:(MGTwitterEngineID)sinceID startingAtPage:(int)pageNum count:(int)count; // search
    - (NSString *)getSearchResultsForQuery:(NSString *)query sinceID:(MGTwitterEngineID)sinceID startingAtPage:(int)pageNum count:(int)count geocode:(NSString *)geocode;
    

    You can find more details in MGTwitterEngine.h. It seems that you don't have to set authentification parameters to make a search, you just have to create an engine :

    twitterEngine = [[MGTwitterEngine alloc] initWithDelegate:self];