在AndroidManifest文件中注册:
<activity android:name=".DeepLinkActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.link.com"
android:scheme="https" />
</intent-filter>
</activity>
在web页中使用:
<div>
<br/><br/>
<a href="https://www.grit-cfg.com">立即打开>></a>
</div>
但是结果是直接在浏览器中跳转,而没有跳转到我指定的界面,但是如果将
android:scheme="https"中的https 替换成其他随意内容,是可以完成跳转的,为什么使用https的时候不行呢
因为开头是https的话浏览器直接走网络请求了,,https的协议,,而不会发送广播到系统,自然就不会跳转了。。
https会让浏览器走网络请求