如何在应用程序中创建深层链接? [英] How to create a deep link in app?
问题描述
我正在应用程序中工作。需要创建一个深层链接。用户可以共享特定项目,并且可以从单击链接打开直接页面。我按照在此处输入链接描述
I am working in app. There need to create a deep link. User can able to share particular item and user can open direct page from click link. I follow enter link description here
<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:scheme="https"
android:host="www.jobzminer.com"
android:pathPrefix="/appplay" />
<data android:scheme="jobzminer"
android:host="appplay" />
</intent-filter>
但是当我将链接放入浏览器时,它将无法正常工作。
but when i put link into browser then its not working.
推荐答案
如评论中所述,将您的网址更新为: https://www.jobzminer.com/appplay
。另外,将浏览器清除为默认应用。
As mentioned in the comments, to update your url to: https://www.jobzminer.com/appplay
. Also clear your browser as a default app.
要传递参数,可以使用查询参数。像这样更改您的网址: https://www.jobzminer.com/appplay?param1=hello¶m2=world
To pass parameters, you could use query parameters. Change your url like this: https://www.jobzminer.com/appplay?param1=hello¶m2=world
然后参加您的活动。这样做:
Then in your activity. Do this:
Intent intent = getIntent();
Uri data = intent.getData();
String param1 = data.getQueryParameter("param1");
String param2 = data.getQueryParameter("param2");
您还可以看到我的答案此处。
You can also see my answer here.
这篇关于如何在应用程序中创建深层链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!