deeplink 原理,deeplink用处

首先在AndroidMainfest.xml中的一个Activity中添加如下配置
<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:scheme="test"
android:host="com.android.test"
android:pathPrefix="/app/test"
/>
</intent-filter>
然后根据添加的data配置组装成一个url,如上的配置可以组合成
'test://com.android.test/app/test?action=1'
【deeplink 原理,deeplink用处】?后面可以携带你先要的参数
这样就可以通过intent获取携带的参数了
例如小程序就可以这样跳转了
router.push({
uri: 'test://com.android.test/app/test?action=1'
})