MGTwitterEngine getUserTimelineFor: does not return retweeted statuses
I'm trying to get 20 user's statuses with
[myEngine getUserTimelineFor:@"username" sinceID:nil startingAtPage:0 count:20]
but the delegate method
- (void)statusesReceived:(NSArray *)statuses forRequest:(NSString *)identifier
returns array of only 15-16 statuses, only the ones posted by that user, not including the statuses he retweeted.
Is there a way to get all requested 20 statuses includ开发者_运维百科ing retweeted? Thanks!
I just started working with MGTwitterEngine, but I believe I see the problem.
The API reference states that the count parameter is the number of statuses + retweets that the caller is interested in, but notes that if the include_rts parameter is not included in the query and set to one, the retweets will not be sent.
Looking at the MGTwitterEngine code, include_rts isn't set by the getUserTimelineFor functions. Since you need it to be, you could subclass MGTwitterEngine and make a new method that allows you to set include_rts, or you could just copy and paste the code below somewhere into your getUserTimelineFor function so that it is added to the list of parameters (you could add it right under the line that sets the count parameter if you wanted to)
[params setObject:[NSString stringWithFormat:@"1"] forKey:@"include_rts"];
https://dev.twitter.com/docs/api/1/get/statuses/user_timeline
精彩评论