android - App Linking 不适用于测试环境

标签 android applinks android-app-links

我正在尝试在我的应用程序中实现应用程序链接。当我打开应用程序时,我有一个带有登录按钮的登录屏幕。按下此登录按钮后,浏览器将进入 Web 登录,然后重定向到应用程序。我想此时直接打开应用程序,但深层链接显示一个对话框。

json 文件位于 https://my_domain/.well-known/assetlinks.json 并且它的 Content-Typeapplication/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/

相关文章:

android - 将 GitHub Android 库发布到 Maven Central

ios - iOS 通用应用程序链接是否可以支持使用同一域的多个应用程序?

android - 如果两个应用程序声明具有相同域的 Android 应用程序链接怎么办

android - Android 12 上的 AppLinks - 仅打开浏览器

android - CKEditor 4.4.7 不显示在任何移动浏览器上

java - Firebase onNewToken 方法无法解析

Android Applink url解决冲突错误

android - Firebase Firestore - 在 Android 上获取同步状态

Android 尝试验证主机,尽管 android :autoVerify ="false"