views:

402

answers:

3

I'd like to allow users to send out Tweets from my iPhone app. That's all the functionality I need at the moment.

From what I know of the Twitter API, there's a standard authentication mechanism, which allows the developer to include the user's name and password in the request string that the application sends to Twitter. This method will no longer be supported come June 30, 2010.

Given the timeframe, the better other choice is oAuth. One of the caveats of oAuth is that it requires a UIWebView to pop up within the app to allow the user to enter his or her credentials or a PIN number.

None of the Twitter apps on my phone do this, however: Tweetie, TweetDeck and Twitterific. I assume they're using the first authentication method, but it seems like Twitter wouldn't deprecate an API that would hurt the user experience across the board.

There must be an alternative method--what am I missing?

+1  A: 

Just because you have a UIWebView does not mean it has to be visible. You can probably use - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script; or some other trickery to submit a form without bothering the user.

Just make sure you give yourself the option of downloading an updated script from your server.

drawnonward
+4  A: 

Twitter provides XAuth for non-web apps.

http://apiwiki.twitter.com/Twitter-REST-API-Method:-oauth-access_token-for-xAuth

lowell
I skipped that because it requires Twitter's explicit permission. Now I know to file a request. Thanks!
thebossman
A: 

Note that http://dev.twitter.com/doc/post/oauth/access_token is the latest documentation.

Hwee-Boon Yar