2012-02-25 53 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