签名错误错误
在我的应用程序中使用 ShareKit 来集成 FB 和推特状态更新。 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 有关。
Using ShareKit in my app to integrate FB & Twitter status updates.
The FB service is working fine. However, in my Twitter service I encountered this error:
Twitter Send Status Error: {"request":"\/1\/statuses\/update.json","error":"Incorrect signature"}
Here's my code:
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];
}
This happen to me on 1-3rd try but when I try to run/debug again the app, it will update successfully.
So, I don't know what's really the problem.
The consumer & secret keys are all correct.
Any idea? It's so strange..googling it around, I didn't find a specific answer but I guess it's something to do with oAuth.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
评论无法格式化,所以我写一个答案。
解决方案是将 twitter.com 更改为 api.twitter.com,对于更新,您需要更改更新 url:
此处修复:https://github.com/ideashower/ShareKit/issues/229#issuecomment-1221634
The comment cannot be formated, so I write an answer.
The solution is to change twitter.com to api.twitter.com and also for updates you need to change the update url:
Fixed here: https://github.com/ideashower/ShareKit/issues/229#issuecomment-1221634