react-navigation / react-navigation/react-navigation.github.io
is android:autoVerify="true" placed in the correct intent-filter?
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 324
- 派生
- 2k
- PR 合并指标
- 30 天内没有已合并 PR
描述
deep link setup for android: https://reactnavigation.org/docs/deep-linking/#setup-on-android
says/shows:
Add android:autoVerify="true" to your entry
and this will be the resulst:
<activity
android:name=".MainActivity"
android:launchMode="singleTask">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="mychat" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="www.example.com" />
</intent-filter>
</activity>
here they are placed on the first intent-filter.
however, when looking at the android docs for android app links: https://developer.android.com/training/app-links#android-app-links
they dont place android:autoVerify="true" on the entry(first) intent-filter where we have:
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
they place android:autoVerify="true" on the intent-filter where we add the scheme and host, which is the third one in the react-navigation example.
so their example looks like this:
<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:scheme="http" />
<data android:scheme="https" />
<data android:host="myownpersonaldomain.com" />
</intent-filter>
so there is a difference in where react-navigation docs and android docs add android:autoVerify="true".
i believe to match the android docs, react-navigation docs example would have to be updated to:
<activity
android:name=".MainActivity"
android:launchMode="singleTask">
- <intent-filter android:autoVerify="true">
+ <intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="mychat" />
</intent-filter>
- <intent-filter>
+ <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:scheme="http" />
<data android:scheme="https" />
<data android:host="www.example.com" />
</intent-filter>
</activity>
thoughts?
EDIT:
i just found this: https://developer.android.com/training/app-links/verify-android-applinks#auto-verification
which says:
When android:autoVerify="true" is present in at least one of your app's intent filters, installing your app on a device that runs Android 6.0 (API level 23) or higher causes the system to automatically verify the hosts associated with the URLs in your app's intent filters.
so maybe its not important which intent-filter you place android:autoVerify="true" after all?
EDIT 2:
from my own personal testing, my android app links only open the app when i place it the way the android docs show. it does not work when i place i the place react-navigation shows.
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 issue 中链接的 Android deep-linking 设置页面开始,将其中关于 intent-filter 的指导与 Android app-links 文档进行比较。找到对应的 React Navigation 文档源文件,根据报告的行为确认哪个 filter 应包含 autoVerify,并更新示例和说明,使文档中的设置明确无歧义。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- android, react-native
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100