How to force Twitter API to comply with callback parameter using OAuth?

I am working on an iPhone application that makes perfect use of OAuth to chat with Twitter. I know that many people make the OAuth workflow inside their applications using UIWebView, but I disagree with this and am going with the Pownce approach .

The problem is that Twitter has this whole scheme of working with desktop applications using a pin number. When I register my application using Twitter, they have a web form asking me if I am a desktop or web client. If I select a desktop client when I try to get user authorization, I can set the oauth_callback parameter, but Twitter will ignore it after authorization and show the pin number. If I indicate on the Twitter form that I am a web client, I need to enter a URL to redirect after authorization. And, since I am using an iPhone-specific URL scheme, their web form does not execute during validation, as it seems to only accept URLs that conform to the HTTP protocol.

So it seems like I'm stuck - I can't say “desktop” because I don't want to worry about a pin, and I can't say “network”, or I can't use the iPhone URL of the application. Any solution for this?

+5
source share
4 answers

From your question:

I know that many people do OAuth workflow inside their applications using UIWebView, but I disagree with this and go with the Pownce approach.

A Pownce article says that exiting the application and opening Mobile Safari to complete the authentication phase is problematic, and that they began to receive poor reviews from users for this. They also experienced a failure rate of about 40%.

Pownce UIWebView , , , , . "" "" .

, , , , - , ( " " / ) - Twitter .

, iPhone:

  • twitter.com UIWebView, oauth_callback oauth_callback=oob, . , iPhone, UIWebView . .
  • , (UIWebView + custom-uri://foo.bar ).

, Twitter URI.

+8

HTTP, 301 URL-, URL- URL- -API Twitter.

, .

0

: Twitter, - -, HTTP://URL-, Twitter oauth-.

URL-, . Twitter ( ) , .

0

- . ( ?) . , . . Twitter, oAuth. . iPhone, , - .

-, .

0
source

All Articles