没有使用FHSTwitterEngine获取推文

时间:2014-01-22 08:59:11

标签: ios iphone twitter tweets fhs-twitter-engine

我正在使用最新的FHSTwitterEngine库。我想从所有用户那里获取最近的20条推文。

我想这样做。

self.engine = [[FHSTwitterEngine alloc] init];
[self.engine permanentlySetConsumerKey:TWITTER_CONSUMER_KEY andSecret:TWITTER_SECRET_KEY];

id res = [self.engine searchTweetsWithQuery: @"cricket" count:10 resultType:FHSTwitterEngineResultTypeRecent unil:[NSDate date] sinceID:@"1920030" maxID:@"1930030"];

NSLog(@"%@",res);

当我这样做时,我得到了这个回复。

Error Domain=FHSErrorDomain Code=401 "You are not authorized via OAuth" UserInfo=0xe5cbce0 {url=https://api.twitter.com/1.1/search/tweets.json, parameters={
    count = 10;
    "include_entities" = false;
    "max_id" = 1930030;
    q = cricket;
    "result_type" = recent;
    "since_id" = 1920030;
    until = "2014-01-22";
}, NSLocalizedDescription=You are not authorized via OAuth}

我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

试试这个

追加

[[self.engine sharedEngine]setDelegate:self];
[[self.engine sharedEngine]loadAccessToken];