【问题标题】:Why twitter OAUTH not redirecting me back to application in CustomWebView in Android?为什么 twitter OAUTH 没有将我重定向回 Android 中 CustomWebView 中的应用程序?
【发布时间】:2011-06-08 23:59:59
【问题描述】:

我正在尝试在自定义 webview 中打开 twitter 集成,因为,

I am using this example

ctx.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));

如果我使用上面的代码,它会在按下按钮时出现问题。重定向和发布状态后。当我按下后退按钮时,它会转到浏览器而不是我的应用程序。我决定使用自定义 webview 通过处理返回事件来避免这种情况。

我正在使用以下示例。但是现在在身份验证浏览器没有将我重定向回我的应用程序但给出错误之后,找不到该页面。? 有人可以帮忙吗?

【问题讨论】:

    标签: android android-webview twitter-oauth


    【解决方案1】:

    我最后修改了我的 CustomeWebView 类方法,以检查重定向 URL 是否以“----”开头,然后从 URL 解析令牌并完成此活动并开始新活动。

    我也找到了一些在 android 中使用 twitter 的好例子

    https://github.com/brione/Brion-Learns-OAuth

    https://github.com/marakana/OAuthDemo

    http://automateddeveloper.blogspot.com/2011/06/android-twitter-oauth-authentication.html

    【讨论】:

      猜你喜欢
      • 2012-08-25
      • 1970-01-01
      • 2011-10-31
      • 2019-11-10
      • 2011-04-10
      • 1970-01-01
      • 2013-07-03
      • 2019-09-25
      • 2021-11-16
      相关资源
      最近更新 更多