如何从手机浏览器打开深层链接?

时间:2017-02-16 10:40:19

标签: android performance android-layout android-fragments deep-linking

我已经为我的应用myapp://video创建了一个深层链接,或者说我还添加了uber://但是当我从Chrome浏览器中打开这些链接时,它需要我google,它不会对待这个作为一个链接,那么如果用户没有从浏览器打开,用户将如何访问此链接的内容。

我尝试了这个,但它打开了谷歌搜索,而不是带我去游戏商店。

请指导我如何使用深层链接?并使用深层链接访问该应用。

enter image description here

清单

<intent-filter>
    <data android:scheme="myapp" android:host="video/>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.BROWSABLE" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

7 个答案:

答案 0 :(得分:6)

Chrome不会将输入到地址栏中的URI方案视为活动链接。您需要将其放在header { position: fixed; width: 100%; min-height: 350px; background-image: url("../resources/img/header.png"); background-position: center; background-size: cover; } header h1 { text-align: center; vertical-align: middle; font-family: Roboto; font-size: 50px; color: #fff; text-transform: uppercase; text-shadow: 1px 1px 1px black; } 元素中。

请注意,虽然这可行,但它不是有效的深层链接解决方案。您应该调查Chrome Intents或完整的深层链接系统,例如Branch.io(完全披露:我在分支机构团队中)或Firebase动态链接。

答案 1 :(得分:5)

好像您的应用配置不正确。

要测试深层链接而不是浏览器,您可以使用ADB:https://developer.android.com/training/app-indexing/deep-linking.html(查看测试深层链接部分)

$ adb shell am start
        -W -a android.intent.action.VIEW
        -d <URI> <PACKAGE>

如果一切正常,那么浏览器可能存在一些问题。

要配置应用以处理深层链接,请阅读:https://developer.android.com/training/app-links/index.html

如果您需要更多信息,请从AndroidManifest.xml发布您的配置:如何处理深层链接。

答案 2 :(得分:5)

一种快速的解决方案是仅转到HTML编辑器,例如以下示例: https://htmledit.squarefree.com/

然后将您的链接粘贴到那里。像这样:

<a href="fb://mygroup">My Facebook Group</a>

编辑器将为您创建链接,您可以点击它并使用移动设备中的深层链接。

答案 3 :(得分:3)

在智能手机中打开深层链接。 enter image description here

  1. 验证您已安装该应用属于深层链接
  2. 在智能手机浏览器(即Chrome)中打开网站Online Link Creator
  3. 输入链接的任何文本,然后将深层链接粘贴到链接输入框中。
  4. 点击生成链接按钮
  5. 现在您可以在按钮下方看到链接
  6. 现在您可以单击该链接。它将在所需的应用程序中打开。
  7. 完成...!

此外,此过程生成html和CSS代码,可以在所见即所得编辑器中使用。

答案 4 :(得分:1)

只需在您的android studio终端上执行此命令

adb shell am start -d deeplink

示例:

adb shell am start -d rm://settingpage/v1

答案 5 :(得分:0)

在我的项目中我已经参考了这两个链接

1.here逐步教程,用于在Android应用中进行深层链接

Medium blog

  1. Android开发者文档

    Deep linking in Android

答案 6 :(得分:0)

Firefox浏览器为我工作。我相信它可以处理私有URI方案

相关问题