2

I am having some issues adding to MGTwitterEngine. I am trying to add a call to friends/ids to return all of a users following ID's. I have a new methods as shown below, but nothing is returned. Do I have the correct requestType or responseType?

- (NSString *)getFriendsIds:(NSString *)twitterID
{
NSString *path = [NSString stringWithFormat:@"friends/ids.%@", API_FORMAT];

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];
[params setObject:twitterID forKey:@"user_id"];

return [self _sendRequestWithMethod:nil path:path queryParameters:params body:nil 
                        requestType:MGTwitterUserInformationRequest
                       responseType:MGTwitterUsers];
}

Solved:

I ended up creating my own method in my model because I couldn't get mgtwitter to do it. Its using ASIHttp.

- (void) getTwitterFollowIDs:(NSString *) twitter_id
{
    [self setResponse: [NSString stringWithFormat:@""]];

    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://api.twitter.com/1/friends/ids.json?user_id=%@", twitter_id]];
    ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL: url];

    // temporary during dev
    [request setValidatesSecureCertificate:NO];

    [request setDelegate:self];
    [request setDidFinishSelector:@selector(getTwitterFollowIDsDidFinish:)];
    [request setDidFailSelector:@selector(getTwitterFollowIDsDidFail:)];

    [request startAsynchronous];
}
bmilleker
  • 83
  • 1
  • 7
  • hmmm, that's nice, but I find another method `[_engine getRecentlyUpdatedFriendsFor:@"user_name" startingAtPage:0];` it is giving me NSArray containing NSDictionaries (containing info of user). However Thanks any way :) – Adil Soomro Feb 08 '12 at 12:30
  • Does that only include 25 friends though? Or whatever a page size is? – bmilleker Feb 08 '12 at 17:05
  • @bmilleker You should extract your edit as an answer and accept it yourself. That will show that the question has an accepted answer. – arcain Jun 15 '12 at 05:24

0 Answers0