我正在尝试在我的应用程序中实现应用程序链接。当我打开应用程序时,我有一个带有登录按钮的登录屏幕。按下此登录按钮后,浏览器将进入 Web 登录,然后重定向到应用程序。我想此时直接打开应用程序,但深层链接显示一个对话框。
json 文件位于 https://my_domain/.well-known/assetlinks.json
并且它的 Content-Type
是 application/json
.
我的 list 文件包含应用链接所需的一切:
<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
。这可能是问题所在吗?
最佳答案
你检查过类似的问题吗? https://stackoverflow.com/a/41945666/5093606 也许您的测试环境中的 SSL 证书无效?
关于android - App Linking 不适用于测试环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56124807/