分享Kitit twitter 403(未知错误)

时间:2012-02-25 17:08:16

标签: ios twitter sharekit

我使用ShareKit通过FB和Twitter分享。我使用此代码分享到Twitter:

- (IBAction)twitterShare:(id)sender {
    // Create the item to share (in this example, a url)
    NSURL *url = [NSURL URLWithString:[flexViewController shareURL]];
    SHKItem *item = [SHKItem URL:url title:[flexViewController shareText]];

    [SHK setRootViewController:self];
    // Share the item
    [SHKTwitter shareItem:item];
}

我得到" 403禁止:服务器理解请求但拒绝履行请求#34;。如果提示登录视图,则总会发生这种情况。如果用户已从先前的会话登录(应用程序已关闭并重新打开),则它可以正常工作。

在此页面中,它声明403表示我已达到限制,我不认为这是我的情况。 https://dev.twitter.com/docs/error-codes-responses

上面的代码上周工作正常,但现在我收到了这个错误。

1 个答案:

答案 0 :(得分:12)

使用旧版本的ShareKit进入相同的问题,并且能够通过编辑SHKTwitter.m的以下部分中的Twitter URL来解决。

    - (void)sendStatus
{
    OAMutableURLRequest *oRequest = [[OAMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://api.twitter.com/1/statuses/update.json"]

ShareKit 2.0版本中的URL不同。