【发布时间】:2019-05-14 07:09:57
【问题描述】:
我正在尝试在我的应用程序中实现应用程序链接。当我打开应用程序时,我有一个带有登录按钮的登录屏幕。按下此登录按钮时,将进入浏览器进行 Web 登录,然后将其重定向到应用程序。我希望我此时直接打开应用程序,但深层链接会显示一个对话框。
json 文件正确位于https://my_domain/.well-known/assetlinks.json,它的Content-Type 是application/json。
我的清单文件包含应用链接所需的一切:
<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="myhost"
android:pathPrefix="/auth"
android:scheme="https" />
<data android:scheme="http"/>
在 Android Studio 的日志中,我得到 SingleHostAsyncVerifier:
Verification result: checking for a statement with source b <
a: "https://host.de"
>
, relation delegate_permission/common.handle_all_urls, and target a <
a <
a: "BE:32:...:17"
>
b: "my_app_package"
>
--> false.
和IntentFilterVerifier 日志:
Verification 172 complete. Success:false. Failed hosts:my_host.
adb shell dumpsys package d 的结果是:
Package: my_app_package
Domains: my_domain
Status: ask
我无法验证https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://web-site&relation=delegate_permission/common.handle_all_urls,因为我的网站不是公开的,它不是生产链接,因此我得到Timeout Error。会不会是这个问题?
【问题讨论】:
-
文档中提到,如果公众无法访问,它将无法工作 > 不要在清单文件中发布您的应用程序,其中包含公众可能无法访问的开发/测试 URL(例如任何只能通过 VPN 访问的)。在这种情况下,一种解决方法是配置构建变体以为开发构建生成不同的清单文件。 developer.android.com/training/app-links/…
-
@RenaudBoulard 我配置了构建变体,每个构建都有不同的清单文件,但尚未在产品构建变体上实现。 assertlinks.json 不在生产网站上,它只在不公开的测试网站上。
标签: android applinks android-app-links