我正在应用程序中工作。需要创建深层链接。用户可以共享特定项目,并且用户可以通过单击链接打开直接页面。我关注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>
但是当我将链接放入浏览器时,它不起作用。
最佳答案
如评论中所述,将您的网址更新为:https://www.jobzminer.com/appplay
。同时将您的浏览器清除为默认应用程序。
要传递参数,您可以使用查询参数。像这样更改您的网址:https://www.jobzminer.com/appplay?param1=hello¶m2=world
然后在您的 Activity 中。这样做:
Intent intent = getIntent();
Uri data = intent.getData();
String param1 = data.getQueryParameter("param1");
String param2 = data.getQueryParameter("param2");
你也可以看我的回答here .
关于android - 如何在应用程序中创建深层链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36280007/