views:

1132

answers:

2

I created a Twitter app I need user of my Android application to authorize its use. I'm at the point where I can call Twitter app page in the browser and successfully authorize. However, the callback seem not to be working, I end up with the confirmation message and PIN in the browser but my Android activity is never called (onResume is not triggered). Here's what I have

  1. Twitter URL: http://twitter.com/oauth/authorize?oauth_token=actualtokenhere&oauth_callback=myapp:///
  2. In my activity definition I have this intent-filter

            <intent-filter>
      <action android:name="android.intent.action.VIEW" />
      <category android:name="android.intent.category.DEFAULT" />
      <category android:name="android.intent.category.BROWSABLE" />
         <data android:scheme="myapp" />
        </intent-filter>
    
  3. As I stated - I get confirmation but not redirect so the Android app is never called back

+1  A: 

Well, turned out there was nothing wrong with my configuration. My twitter app simply had wrong setting for the "Application Type" If you have this problem - go to your app edit view on Twitter and check "browser" option for the "Application Type", then if authentication succeeds browser redirects to the callback URL. Now - I couldn't use Android-style callback URL (myapp://twitt) since that would not pass form validation. But turned out - you can enter anything that is valid URL there and provide the actuall callback URL in your code

DroidIn.net
A: 

hey Droidln I am having the same problem can you plz elaborate or explain with some sample code. I really need it to work asap.Please help Thanks in advance

Snigdha
I have a tutorial on this @ http://is.gd/fEs0G. It's bit dated and I haven't come back to review it but see if it can help you
DroidIn.net
thanks a lot...its really helpful tutorial.Can you plz tell me if i want to open the auth in dialog as in facebook authentication because in this case if user click on the back button the the browser gets reopend and thats kind a messy.
Snigdha