小编Dav*_*son的帖子

Android:使用intent-filter处理OAuth回调

我正在构建一个需要OAuth的Android应用程序.除了处理来自Yahoo的回调之外,我的所有OAuth功能都有效.我在AndroidManifest.xml中有以下内容:

  <intent-filter>
    <action android:name="android.intent.action.VIEW"></action> 
    <category android:name="android.intent.category.DEFAULT"></category> 
    <category android:name="android.intent.category.BROWSABLE"></category>
    <data android:host="www.test.com" android:scheme="http"></data> 
  </intent-filter>

www.test.com将被我拥有的域名替换.它似乎 :

  • 单击页面上的链接时会触发此过滤器.
  • 它不是由雅虎重定向触发的,浏览器在www.test.com上打开网站
  • 当我直接在浏览器中输入域名时,不会触发它.

所以任何人都可以帮助我

  • 什么时候会触发这个意图过滤器?
  • 对intent-filter或权限的任何更改都会扩展过滤器以应用于重定向请求?
  • 我可以使用的任何其他方法?

谢谢你的帮助.

android oauth

11
推荐指数
1
解决办法
4824
查看次数

Android http方案的意图过滤器

我构建了一个需要 OAuth 的 Android 应用程序。使用由 Android 拦截的自定义方案回调,一切运行良好。雅虎似乎已经更改了目标帖子,现在雅虎不接受自定义方案。

我现在正在寻找可能的替代方法。我的第一次尝试是使用普通的 http 方案并修改我的意图过滤器以拦截新的 URL。我的 AndroidManifest.xml 中有以下内容:

  <intent-filter>
    <action android:name="android.intent.action.VIEW"></action> 
    <category android:name="android.intent.category.DEFAULT"></category> 
    <category android:name="android.intent.category.BROWSABLE"></category>
    <data android:host="www.test.com" android:scheme="http"></data> 
  </intent-filter>
Run Code Online (Sandbox Code Playgroud)

其中 www.test.com 将替换为我拥有的域名。它似乎 :

  • 当我点击页面上的链接时,会触发此过滤器。
  • 雅虎重定向不会触发它,浏览器会打开 www.test.com 网站
  • 当我在浏览器中直接输入域名时不会触发。

那么有人可以帮助我吗

  • 这个意图过滤器到底什么时候会被触发?
  • 对意图过滤器或权限进行的任何更改都会扩大过滤器以应用于重定向请求吗?
  • 我还可以使用其他方法吗?

感谢您的帮助。

android android-manifest

5
推荐指数
1
解决办法
3528
查看次数

标签 统计

android ×2

android-manifest ×1

oauth ×1