【问题标题】:Incorrect signature error不正确的签名错误
【发布时间】:2011-08-29 10:26:19
【问题描述】:

在我的应用程序中使用 ShareKit 来集成 FB 和 Twitter 状态更新。 FB 服务运行良好。但是,在我的 Twitter 服务中,我遇到了这个错误:

Twitter Send Status Error: {"request":"\/1\/statuses\/update.json","error":"Incorrect signature"}

这是我的代码:

if (m_prodDetails != nil && [m_prodDetails count] > 0) {
    NSString *strTemp = [[NSString alloc] initWithString:API_HOSTSERV_PROD_URL];
    // http://ipasarmalam.com/p/proddetails.aspx?id=55344
    NSString *urlString = [strTemp stringByAppendingString: [m_prodDetails objectAtIndex:0]];

    NSURL *url = [NSURL URLWithString:urlString];
    if (url != nil) {
        NSLog(@"url is correct: %@", url);            
    }
    NSLog(@"urlString: %@", urlString);
    NSLog(@"url: %@", url);

    SHKItem *item = [SHKItem URL:url title:m_prodName.text];
    SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
    [actionSheet showFromTabBar:self.tabBarController.tabBar];  

    [strTemp release];
}

这在我第 1-3 次尝试时发生,但是当我再次尝试运行/调试应用程序时,它会成功更新。

所以,我不知道真正的问题是什么。 消费者密钥和密钥都是正确的。

有什么想法吗?太奇怪了。。谷歌搜索,我没有找到具体的答案,但我想这与 oAuth 有关。

【问题讨论】:

  • Twitter oAuth 已更新并在 ShareKit 端中断。需要将 twitter.com 更改为 api.twitter.com 。在此处提交错误并修复。 bit.ly/k5nnbB
  • 谢谢谢谢谢谢!!还要记住将更新 URL 更改为 https OAMutableURLRequest *oRequest = [[OAMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"api.twitter.com/1/statuses/update.json"] consumer:consumer token:accessToken realm:nil signatureProvider:nil];

标签: iphone ios twitter sharekit


【解决方案1】:

评论无法格式化,所以我写一个答案。 解决方案是将 twitter.com 更改为 api.twitter.com 并且对于需要更改更新 url 的更新:

OAMutableURLRequest *oRequest = [[OAMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"api.twitter.com/1/statuses/update.json"] consumer:consumer token:accessToken realm:nil signatureProvider:nil];

固定在这里:https://github.com/ideashower/ShareKit/issues/229#issuecomment-1221634

【讨论】:

    猜你喜欢
    • 2011-06-13
    • 1970-01-01
    • 1970-01-01
    • 2011-06-13
    • 2014-09-20
    • 1970-01-01
    • 1970-01-01
    • 2019-02-19
    • 1970-01-01
    相关资源
    最近更新 更多