iphone twitter and sharing

老子叫甜甜 提交于 2020-01-02 16:03:13

问题


Has anyone encountered the following error message when sending to Twitter?

"Error: Incorrect signature"

And on the debug console:

<0xf14cf80 SHKTwitter.m:(356)> Twitter Send Status Error: {"request":"\/1\/statuses\/update.json","error":"Incorrect signature"}

So far as I can tell I've followed the install instructions on http://www.getsharekit.com/install/#download and it is working with Facebook, e-mail etc. just not Twitter.

It would be great if someone has seen this error before and goes "aha!".


回答1:


All I did to enable twitter Sharing is:

  1. Regitered my App as a Twitter APP (Application Type: Browser)
  2. #define SHKTwitterConsumerKey @"My..." #define SHKTwitterSecret @"My..." #define SHKTwitterCallbackUrl @"http://www.anything.com/callback" // You need to set this if using OAuth, see note above (xAuth users can skip it) \#define SHKTwitterUseXAuth 0 // To use xAuth, set to 1 \#define SHKTwitterUsername @"" // Enter your app's twitter account if you'dlike to ask the user to follow it when logging in. (Only for xAuth)

    • Note that for the callback function you can enter any URL you want. even www.google.com. Just make sure it is the same URL in your code.



回答2:


The issue is that you're signed into your twitter account, and allowed the app to connect to your profile.

However, days go by, the Key and Secret change, and now you're seeing this error. It's because you have to log out and re-log back into Twitter. I spent waaay too much time finding this out when I created a new Twitter App to hook into (and organize my apps) and found this error.

Basically, ShareKit is saving your login info, auto-logging you in, and getting the error when twitter says the app doesn't have permission to connect to your profile.

Follow these steps to log yourself out and test again :

http://www.getsharekit.com/docs/#logout




回答3:


Check this previous SO question, it might be able to help you solve the problem: Twitter API status update always returns "Incorrect signature"



来源:https://stackoverflow.com/questions/4301483/iphone-twitter-and-sharing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!