Android原生Twitter应用程序 - 不重定向回原始应用程序

时间:2012-10-14 18:08:29

标签: android twitter twitter4j signpost

我有一个项目,在发布推文之前,我正在使用twitter oAuth流程来通过twitter对用户进行身份验证。

问题是oAuth在流程结束时重定向回应用程序不起作用,但仅当用户为流程选择Twitter应用程序时 - 即“使用...完成此操作”具有两个浏览器和Twitter。

当使用浏览器完成oAuth流程时,这可以100%正常工作 - 推特页面重定向,捕获特定于应用程序的URL,并在调用onResume时传递正确的意图。

本机Android Twitter应用程序继续显示“将您重定向到应用程序。这可能需要一些时间”,并且它不会重定向。事实上,在进入原生Twitter应用程序时,logcat中没有任何关于身份验证过程的内容。还应该注意,单击上一页上的“取消”按钮也没有做任何事情 - logcat中没有任何内容表明Twitter本机应用程序甚至试图回调到原始应用程序。

这是从oAuth“Auth Url”意图被触发的点开始的logcat:

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

我很清楚Twitter应用程序设置中的“虚拟URL”问题,并且由于浏览器流程工作得很好,我看不出这就是问题。

在Nexus S + Android 4.1.1上进行测试,也是LG Sprint(不确定型号)+ Android 2.3.3。两种情况下的行为都是相同的。

0 个答案:

没有答案