eddyfice
eddyfice

Reputation: 41

Android Native Twitter App - Not Redirecting Back To Original Application

I've got a project where I'm using the twitter oAuth flow to authenticate a user with twitter, prior to posting a tweet.

The issue is that the oAuth redirect back to the application at the end of the flow does not work, but only when the user selects the Twitter app for the flow - i.e. "Complete this action with..." has both Browser and Twitter.

This works 100% when the oAuth flow is completed using the browser - the twitter page redirects, the app-specific URL is caught and the app is passed the correct intent when onResume is called.

The native Android Twitter app proceeds to the point where it displays "Redirecting you back to the application. This may take a few moments", and it does not redirect. In fact upon entering the native Twitter app, there is nothing further in the logcat regarding the auth process. Should also be noted, that clicking the "cancel" button on the previous page does not do anything either - nothing appears in the logcat to suggest that the Twitter native app is even attempting to callback to the original app.

Here's the logcat from the point at which the oAuth "Auth Url" intent is fired:

I/ActivityManager(  251): START {act=android.intent.action.VIEW     dat=https://twitter.com/oauth/authorize?oauth_token=zpY3RH5tzyM2SuB2TfNfI1tou8VpLTw14xNmMFs8A flg=0x3000000 cmp=com.twitter.android/.UrlInterpreterActivity u=0} from pid 251
I/ActivityManager(  251): START {dat=https://twitter.com/oauth/authorize?oauth_token=zpY3RH5tzyM2SuB2TfNfI1tou8VpLTw14xNmMFs8A cmp=com.twitter.android/.WebViewActivity u=0} from pid 8560
V/PhoneStatusBar(  352): setLightsOn(true)
I/ActivityManager(  251): Displayed com.twitter.android/.WebViewActivity: +225ms (total +267ms)
D/TilesManager( 8560): new EGLContext from framework: 5151cd88 
D/GLWebViewState( 8560): Reinit shader
D/GLWebViewState( 8560): Reinit transferQueue
W/ThrottleService(  251): unable to find stats for iface rmnet0
D/AudioHardware(   90): AudioHardware pcm playback is going to standby.
D/AudioHardware(   90): closePcmOut_l() mPcmOpenCnt: 1
D/SizeAdaptiveLayout(  352): com.android.internal.widget.SizeAdaptiveLayout@42100048child view android.widget.FrameLayout@420a2188 measured out of bounds at 95px clamped to 96px
D/SizeAdaptiveLayout(  352): com.android.internal.widget.SizeAdaptiveLayout@41e4ac40child view android.widget.FrameLayout@4204c8b8 measured out of bounds at 95px clamped to 96px
D/dalvikvm( 8272): WAIT_FOR_CONCURRENT_GC blocked 0ms
D/dalvikvm( 8272): GC_EXPLICIT freed 365K, 11% free 10374K/11655K, paused 2ms+3ms, total 36ms

I am well aware of the "dummy URL" issue in the Twitter application settings, and since the Browser flow works just fine, I can't see that being the issue.

Testing performed on Nexus S + Android 4.1.1, also LG Sprint (unsure of model) + Android 2.3.3. Behaviour is identical in both scenarios.

Upvotes: 3

Views: 909

Answers (0)

Related Questions