You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android/React Native Deep Linking问题:为何用户看到重复重定向选项?

React Native Android应用Garmin OAuth 1.0授权重定向异常问题

我们的React Native Android健康应用通过OAuth 1.0协议请求授权,获取Garmin用户数据以追踪步数和健身情况。用户完成授权后,Garmin会将用户重定向回应用,我们需要处理重定向URL中的oauth_verifier参数来完成OAuth握手流程。

但目前出现异常:用户点击授权后,系统会弹出两个显示相同应用名称和图标的选项,只有点击第二个“在其他应用中打开”选项,才能触发React Native Linking组件处理完整的重定向URL,进而完成OAuth 1.0握手。

问题时间线

  • 今年5月该授权流程仍能正常运行,由于绑定Garmin设备的Android用户数量极少,暂时无法确定Bug的具体出现时间。
  • 今年春季首次出现该Bug时,曾通过在AndroidManifest.xml的intent filter标签中添加android:host="garmin"参数修复了问题。

修复时的配置代码

AndroidManifest.xml相关片段:

<!--OAuth Garmin URI Scheme-->
<intent-filter android:exported="true">
    <!--Redirecting back to app after authorizing-->
    <data android:scheme="com.wellnessapp.auth" android:host="garmin"/>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
</intent-filter>

当前配置状态

  • 清单文件中无其他intent使用com.wellnessapp.auth这个scheme
  • 该字符串仅在build.gradle的defaultConfig对象中出现:manifestPlaceholders = [appAuthRedirectScheme: "com.wellnessapp.auth"]

内容的提问来源于stack exchange,提问作者Matt Dow

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 02:55:02