How can I authenticate a Twitter user and access the API without leaving my iPhone application?

I want to allow users to send Tweets from my iPhone application. These are all the functionalities that I need at the moment.

From what I know about the Twitter API, there is a standard authentication mechanism that allows the developer to include the username and password in the request string that the application sends to Twitter. This method will no longer be supported on June 30, 2010.

Given the time frame, oAuth is the best choice. One of the cautions of oAuth is that this requires the UIWebView to appear in the application so that the user can enter their credentials or PIN.

None of the Twitter apps on my phone do this: Tweetie, TweetDeck, and Twitterific. I assume they use the first authentication method, but it looks like Twitter will not discount the API, which will hurt the user interface.

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

+4
source share
3 answers

Twitter provides XAuth for non-web applications.

https://dev.twitter.com/docs/oauth/xauth

+5
source

Just because you have a UIWebView does not mean that it should be visible. Perhaps you can use - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script; or any other fraud to submit the form without disturbing the user.

Just make sure you provide the ability to download the updated script from your server.

+1
source

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

0
source

Source: https://habr.com/ru/post/1308206/


All Articles