如何为Android应用程序创建深度链接 [英] How to create Deep Link for an Android Application

查看:186
本文介绍了如何为Android应用程序创建深度链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在 Google Play商店上创建并部署了一个应用程序,我需要为该应用程序创建一个Deep Link.我已经搜索过,但是无法找到任何方法来为我的应用程序创建Deep Link.

I have created and deployed an Application on Google Play Store, I need to create a Deep Link for that app. I have searched, but unable to find out any way to create Deep Link for my application.

请指导我如何为该应用程序创建深度链接.

Kindly guide me how can i create a Deep Link for this application.

谢谢

推荐答案

如Android文档所述:

As Android documentation says:

要使Google能够抓取您的应用内容并允许用户从搜索结果中进入您的应用,您必须在应用清单中添加针对相关活动的意图过滤器.这些意图过滤器允许您在任何活动中深度链接到内容.例如,用户可能单击深层链接以查看购物应用程序中的页面,该页面描述了用户正在搜索的产品.

To enable Google to crawl your app content and allow users to enter your app from search results, you must add intent filters for the relevant activities in your app manifest. These intent filters allow deep linking to the content in any of your activities. For example, the user might click on a deep link to view a page within a shopping app that describes a product offering that the user is searching for.

为此,您需要在清单中添加具有 action data category 属性的意图过滤器:

To do this you need to add an intent filter in your Manifest with action, data and category attributes:

<activity
android:name="com.example.android.GizmosActivity"
android:label="@string/title_gizmos" >
<intent-filter android:label="@string/filter_title_viewgizmos">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <!-- Accepts URIs that begin with "http://www.example.com/gizmos" -->
    <data android:scheme="http"
          android:host="www.example.com"
          android:pathPrefix="/gizmos" />
    <!-- note that the leading "/" is required for pathPrefix-->
    <!-- Accepts URIs that begin with "example://gizmos" -->
    <data android:scheme="example"
          android:host="gizmos" />

</intent-filter>

您可以在 developers.android 中了解有关深层链接的更多信息.a>

You can read more about deep linking in developers.android

这篇关于如何为Android应用程序创建深度链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆