0

我已经从源代码https://github.com/kimptoc/MGTwitterEngine-1.0.8-OAuth尝试了用于 oAuth 的 MGTwitterEngine

我正在将此代码用于 MGTwitterEngine oAuth... 但不适用于我...

它给出了与我在使用 xAuth 时没有启用集成在 Iphone App 中的 xAuth Twitter 时相同的错误

错误日志是:

Twitter request failed! (3AFB8476-929F-4467-A4FE-DE43358CB62A) Error: The operation couldn’t be completed. (HTTP error 401.) ((null))

还有一件事我在设置应用程序密钥和秘密中没有找到任何东西?

由于这个原因可能是错误的..请帮助我。

在 twitter 按钮选项卡上编辑代码

-(IBAction)twitterBtnAct:(id)sender{
    // Put your Twitter username and password here:
    NSString *username = @"username";
    NSString *password = @"password";

    // Make sure you entered your login details before running this code... ;)
    if ([username isEqualToString:@""] || [password isEqualToString:@""]) {
        NSLog(@"You forgot to specify your username/password in AppController.m!");
    }

    // Create a TwitterEngine and set our login details.
    twitterEngine = [[MGTwitterEngine alloc] initWithDelegate:self];
    [twitterEngine setUsername:username password:password];

    // Get updates from people the authenticated user follows.
    [twitterEngine getFollowedTimelineFor:username since:nil startingAtPage:0];
}

阿米特巴坦

4

2 回答 2

0

HTTP 401 错误与身份验证问题有关。在项目中,应用程序执行以下操作:

 twitterEngine = [[MGTwitterEngine alloc] initWithDelegate:self];
 [twitterEngine setUsername:username password:password]

你有在你的应用程序中设置这个吗?

于 2011-03-03T08:18:44.580 回答
0

我已经使用https://github.com/bengottlieb/Twitter-OAuth-iPhone进行 oAuth

于 2011-03-10T12:50:07.300 回答