How to connect to Twitter from iPhone?

2020-05-02 04:23发布

问题:

I need share on twitter in my application through iPhone.App has to tweet in the twitter. There is a button action on clicking which twitter login page should open. How to do this? Code for this appreciable.. Thank You.

回答1:

You can use Twitter-OAuth-iPhone. However, if you are using SDK < 3.2 then you need to download an old version. There is a demo app included which shows how to login and tweet clearly.

For a tutorial on this, check this.



回答2:

Basically you need to refer to Twitter's page for libraries using OAuth on iOS.

Alternatively you may always use the "?status=" method:

http://mobile.twitter.com/?status=<YOUR MSG IN URI-ENCODED FORM>

However that may not work if the user have not signed in yet. Try the OAuth methods which would be harder to implement but safer for sending messages.