Orb*_*bit 11 android intentfilter chrome-custom-tabs android-customtabs android-deep-link
我想捕获 Chrome 自定义选项卡中发生的重定向,以确保用户留在本机移动应用程序中。
Chrome 自定义选项卡的启动方式如下:
val url = "https://demo.company.com/sso/oidc/start/?idp_connection_id=Username-Password-Authentication&status_response_url=https://member.example.com/urgent"
val builder = CustomTabsIntent.Builder()
val customTabsIntent = builder.build()
customTabsIntent.launchUrl(this, Uri.parse(url))
Run Code Online (Sandbox Code Playgroud)
status_response_url在用户进行身份验证后,该网页将重定向到作为参数给出的 URL 。移动应用程序注册适当的方案:
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="member.example.com"
android:scheme="https" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
不幸的是,系统似乎没有捕获重定向。为什么?
由于缺乏用户手势,这是应用程序链接和 SSO 的一个众所周知的问题。
您正在使用首选的声明 HTTPS 方案选项,但需要一个插页式网页才能使其可靠工作。
我的博客文章提供了这方面的更多信息,包括您可以运行以查看用户体验的代码示例。
| 归档时间: |
|
| 查看次数: |
6333 次 |
| 最近记录: |