【发布时间】:2021-01-06 00:37:24
【问题描述】:
我正在尝试使用 build.gradle 作为 referenecd here 将 url 架构和路径动态注入到我的 AndroidManifest.xml 文件中
但是,这不允许触发深层链接。
当我在 AndroidManifest.xml 中使用静态值时,我测试了我的深度链接工作。
// AndroidManifest.xml
<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="${appScheme}"
android:host="${hostName}"
android:path="/path2" />
<data
android:scheme="${appScheme}"
android:host="${hostName}"
android:path="/path1" />
</intent-filter>
// build.gradle (:app)
defaulConfig {
manifestPlaceholders = [
hostName: "www.host_name.com",
appScheme: "https"
]
}
demo {
resValue "string", "hostName", "www.host_demo.com"
resValue "string", "appScheme", "https"
}
staging {
resValue "string", "hostName", "www.host_staging.com"
resValue "string", "appScheme", "http"
}
【问题讨论】:
-
However, this does not allow deeplinks to trigger.是什么意思?它不能与每种风味定义的 resValue 一起使用吗?
标签: android android-manifest deep-linking