2012-02-25 101 views
3

我使用ShareKit通过FB和Twitter分享。我使用这个代码分享到Twitter:ShareKit twitter 403(未知错误)

- (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禁止:服务器理解请求,但是拒绝执行它。”如果提示登录视图,这总是会发生。如果用户已经从较早的会话登录(应用程序已关闭并重新打开),则它可以正常工作。

在这个页面上,它声明403意味着我已经达到了极限,我不认为这是我的情况。 https://dev.twitter.com/docs/error-codes-responses

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

回答

12

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

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

该URL在ShareKit 2.0版本中有所不同。

+0

谢谢。我尝试了它并且工作了,但是我已经切换到了不同的工具包。 – Basel 2012-03-04 20:00:46