问题
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.
Thanks
回答1:
As Android documentation says:
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.
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>
You can read more about deep linking in developers.android
来源:https://stackoverflow.com/questions/41057911/how-to-create-deep-link-for-an-android-application