Android-Link

2020-09-15  本文已影响0人  有腹肌的豌豆Z

简介

DeepLink与AppLink,本质上都是基于Intent框架,使App能够识别并处理来自系统或其他App的某种特殊URL,在原生App之间相互跳转,实现良好的用户体验

Scheme相关

https://www.jianshu.com/p/0de981ffa9d0

什么是DeepLink?
什么是AppLink?
什么是Deferred DeepLink?
DeepLink和AppLink核心技术

DeepLink实践方案

目标Activity Mainfest.xml 配置
<!--用于DeepLink,html跳到此页面  scheme_Adr: 'shark://link/?page=main',-->
<activity android:name=".activity.link.SchemeActivity"
    android:screenOrientation="portrait">
    <!--Android 接收外部跳转过滤器-->
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <!-- 协议部分配置 ,要在web配置相同的-->
        <!--shark://link/?page=main-->
        <data
            android:host="link"
            android:scheme="shark" />
    </intent-filter>
</activity>    

数据解析 调用 参考 Scheme

https://www.jianshu.com/p/0de981ffa9d0


AppLink实践方案

上一篇 下一篇

猜你喜欢

热点阅读