android - 深层链接 Activity 打不开

标签 android

我正在使用以下代码在我的应用中打开一个 Activity

<intent-filter>
            <action android:name="android.intent.action.VIEW"></action>

            <category android:name="android.intent.category.DEFAULT"></category>
            <category android:name="android.intent.category.BROWSABLE"></category>

            <data android:host="google.com"></data>
            <data android:scheme="https"></data>
            <data android:pathPattern="/.*"></data>

        </intent-filter>

在浏览器中输入 google.com 时,它没有打开我的 Activity 。我也尝试过其他链接,但没有成功。我尝试点击 Gmail 等邮件,但没有成功。

我是不是漏掉了什么。

提前致谢。

最佳答案

从 API 23+ 开始,您需要在用于链接到您的应用程序的网站/服务器上有一个文件,其中包含您的 Android 应用程序的包名称。此 Digital Asset Links 文件验证是否允许该应用程序打开来自相关网站的链接。您还需要将 android:autoVerify="true" 添加到 intent-filter(它会标记操作系统以在安装时使用您尝试深度链接的域验证您的应用程序)。否则,您无法从 http/https 深度链接到您的 Android 应用程序。自定义架构链接(例如 myschema://data_here)仍然有效,无需任何验证。

有关 Android 应用程序链接验证的更多信息,see here

此外,为了将来引用,Apple 有相同的验证要求,尽管有一个 apple-app-site-association 文件:see here

关于android - 深层链接 Activity 打不开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46096789/

相关文章:

android - Calabash-android执行iphone模拟器

java - Android studio中的java文件错误

android - Android 上的 flex 盒

android - 每次在溢出选项菜单中打开时复制菜单项

android - 将 ConstraintLayout 放置在 NestedScrollView 中时如何使用整个空间?

Android Studio : Pair devices over Wi-Fi - This system does not meet requirements to support Wi-Fi pairing

android - 在 Qt Android 中在哪里进行最后一分钟的清理?

jquery - 为 "samsung galaxy Android 2.3.5"检测方向(横向和纵向模式)的事件

Android Studio 一直找不到目标 android-19 但我不想用它编译

android - Parse.com 不保存 ParseObjects