6

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

Bostone
  • 36,858
  • 39
  • 167
  • 227

1 Answers1

7

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

Bostone
  • 36,858
  • 39
  • 167
  • 227
  • I am having the same problem. I can't find any Settings Like browser options. Please check my code http://pastie.org/2255040. After user Sign in Successfully i am unable to Redirect back to my Application. Please come to this room if http://chat.stackoverflow.com/rooms/1531/casual-chat Please Help me. Thanks Venky. – Venky Jul 22 '11 at 17:22
  • Bostone can you please guide me a bit on creating a twitter "FOLLOW US" button to integrate in my android app. Atleast some link which describes it. – Chandra Sekhar Jun 29 '12 at 19:22