Android DeepLink介绍与使用

前段时间公司让调研一下DeepLink,说以后会用到,之前看了很久,并做了个demo,现整理一下,方便以后查阅,如果有幸帮助到其他人就更好了。

基本概念
Deep Link,又叫deep linking,中文翻译作深层链接。

简单地从用户体验来讲,Deep Link,就是可以让你在手机的浏览器/Google Search上点击搜索的结果,便能直接跳转到已安装的应用中的某一个页面的技术。

对于不懂技术的运营人员来说就是一个分享功能,而从技术层面上去简单理解是实现将某APP用户带到另外APP相对应的内容页面,实现APP之间无缝跳转!

商业价值
相信大家或多或少看到过这样的页面:

底部有一个“App内打开”,点击后如果安装过应用直接跳到应用的对应页面,如果没安装则跳到下载应用页。

Deeplink(深度链接)
对于已经安装APP,指向特定的页面,和上面说的一致。

Deferred deeplink( 延迟深度链接)
相比deeplink,它增加了判断APP是否被安装,用户匹配的2个功能;

1.当用户点击链接的时候判断APP是否安装,如果用户没有安装时,引导用户跳转到应用商店下载应用。
2.用户匹配功能,当用户点击链接时和用户启动APP时,分别将这两次用户Device Fingerprint(设备指纹信息)传到服务器进行模糊匹配,使用户下载且启动APP时,直接打开相应的指定页面。
通过上面的2个技术方案,不仅:①可以让被分享者更快更便捷的回到APP,且回到指定的活动页面,而且:②可以引导未安装APP的用户下载APP、③分享者和被分享者的关系链会通过设备指纹信息记录下来,在业务场景中给出相应的*励。

使用deeplink前后对比:

基本使用
具体见Demo:WebViewStudy

HTML页面:deeplink.html
<a href=”[scheme]://[host]/[path]?[query]”>启动应用程序</a>
1
示例:

<a href=”will://link/testId”>立即打开(直接打开)&gt;&gt;</a>

AndroidManifest.xml
<!–用于DeepLink,html跳到此页面 scheme_Adr: ‘will://link/testid’,–>
<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=”link”
android:scheme=”will” />
</intent-filter>
</activity>
</application>

MyWebViewClient.class
@SuppressWarnings(“deprecation”)
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (TextUtils.isEmpty(url)) {
return false;
}
try {
// 用于DeepLink测试
if (url.startsWith(“will://”)) {
Uri uri = Uri.parse(url);
Log.e(“———scheme”, uri.getScheme() + “;host: ” + uri.getHost() + “;Id: ” + uri.getPathSegments().get(0));
}

Intent intent1 = new Intent();
intent1.setAction(“android.intent.action.VIEW”);
Uri uri = Uri.parse(url);
intent1.setData(uri);
intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mActivity.startActivity(intent1);
} catch (Exception e) {
e.printStackTrace();
}
return true;
}

DeepLinkActivity.java
/**
* 从deep link中获取数据
* ‘will://share/传过来的数据’
*/
private void getDataFromBrowser(TextView textView) {
Uri data = getIntent().getData();
try {
String scheme = data.getScheme();
String host = data.getHost();
List<String> params = data.getPathSegments();
// 从网页传过来的数据
String testId = params.get(0);
String text = “Scheme: ” + scheme + “\n” + “host: ” + host + “\n” + “params: ” + testId;
Log.e(“ScrollingActivity”, text);
textView.setText(text);
} catch (Exception e) {
e.printStackTrace();
}
}

页面具体显示:

Scheme:will
host:link
params:testId

实现原理
DeepLink用到的核心技术就是:URL SCHEMES。不论是IOS还是Android。
URL Schemes 有两个单词:

URL,我们都很清楚,http://www.apple.com 就是个 URL,也叫它链接或网址;
Schemes,表示的是一个 URL 中的一个位置——*初始的位置,即 ?/之前的那段字符。比如 http://www.apple.com 这个网址的 Schemes 是 http。
我们可以像定位一个网页一样,用一种特殊的 URL 来定位一个应用甚至应用里某个具体的功能。而定位这个应用的,就应该这个应用的 URL 的 Schemes 部分,也就是开头儿那部分。但是需要注意的是应用的URL Schemes 并不唯一,也就是说一个应用可以“起多个名“,不同应用的URL Schemes也可能因为名字一样发生冲突。

Android系统级应用,有一些已经定义了URL Schemes,比如短信是 sms:、通话是tel:、email是mailto:,在定义自己APP的URL Schemes的时候要避免跟系统应用名称一样。

<a href=”tel:15088888888″>电话</a>
<a href=”sms:15088888888″>短信</a>
<a href=”mailto:15088888888@qq.com”>邮件</a>

与URL一样,URL Schemes也可以通过传参打开特定的APP界面。

URL:http://images.google.com/images?q=关键字
URL Schemes:weixin://dl/moments(打开微信朋友圈)
Applink
基本介绍
官网文档:Verify Android App Links

Android App Links是一种特殊的Deep Links,它使Android系统能够直接通过网站地址打开应用程序对应的内容页面,而不需要用户选择使用哪个应用来处理网站地址。

要添加Android App Links到应用中,需要在应用里定义通过Http(s)地址打开应用的intent filter,并验证你确实拥有该应用和该网站。如果系统成功验证到你拥有该网站,那么系统会直接把URL对应的intent路由到你的应用。

为了验证你对应用和网站的所有权,以下两个步骤是必须的:

1.在AndroidManifest里要求系统自动进行App Links的所有权验证。这个配置会告诉Android系统去验证你的应用是否属于在intent filter内指定的URL域名。
2.在以下链接地址里,放置一个数字资产链接的Json文件,声明你的网址和应用之间的关系:
https://domain.name/.well-known/assetlinks.json
与Deep Links的区别
Deep Links 是一种允许用户进入应用某个特定Activity的intent filter。点击这类链接时,系统可能会弹出一个选择列表,让用户在一堆能够处理这类链接的应用里(包括你的)选择一个来处理该链接。图一展示了这样一种情况:用户点击了一个地图相关的链接,系统弹出一个选择列表,让用户选择是要使用地图应用来处理,还是使用Chrome浏览器来处理。

App Links 是一种基于你的网站地址且验证通过的Deep Links。因此,点击一个这样的链接会直接打开你的应用(如果已经安装),系统将不会弹出选择列表。当然,后续用户可以更改配好设置,来指定由哪个应用程序处理这类链接。

下面这个列表描述更多差异:

%title插图%num

总结一下
1.APP要想被其他APP直接打开,自身得支持,让自己具备被人打开的能力。(URL Schemes)
2.APP要想打开其他的APP,自身也得支持。(判断设备是否安装、各种跳转的处理)
由于大部分应用,如微博、微信、第三方浏览器(包括Chrome),都不会将URL抛给系统处理(对scheme进行屏蔽),因此App Links生效的情况就很有限了,比如只能从记事本应用、短信应用这些进行跳转。一般商用实现的是打开系统浏览器,通过系统浏览器打开应用的对应页面。

京东及淘宝的CPS即是使用此方式实现的。
京东CPS商品推广接入流程
Android 阿里百川cps SDK接入流程

一些常用APP的URL Schemes
知乎:回答 zhihu://answers/{id}用户页 zhihu://people/{id}
微信:
weixin://dl/scan 扫一扫weixin://dl/feedback 反馈weixin://dl/moments 朋友圈weixin://dl/settings 设置weixin://dl/notifications 消息通知设置weixin://dl/chat 聊天设置weixin://dl/general 通用设置weixin://dl/officialaccounts 公众号weixin://dl/games 游戏weixin://dl/help 帮助weixin://dl/feedback 反馈weixin://dl/profile 个人信息weixin://dl/features 功能插件

腾讯微博:TencentWeibo://
淘宝:taobao://
支付宝:alipay://
微博:sinaweibo://
weico微博:weico://
QQ浏览器:mqqbrowser://
uc浏览器:ucbrowser://
海豚浏览器:dolphin://
搜狗浏览器:SogouMSE://
百度地图:baidumap://
Chrome:googlechrome://
优酷:youku://
京东:openapp.jdmoble://
人人:renren://
美团:imeituan://
1号店:wccbyihaodian://
我查查:wcc://
有道词典:ddictproapp://
点评:dianping://
微盘:sinavdisk://
豆瓣fm:doubanradio://
网易公开课:ntesopen://
名片全能王:camcard://
淘宝宝贝搜索:taobao://http://s.taobao.com/?q=[prompt]
淘宝店铺搜索:taobao://http://shopsearch.t

Android DeepLink的实现原理

前言

之前我们又是看源码又是研究动画,今天分享一个比较简单的技术点:DeepLink。

DeepLink,深度链接技术,主要应用场景是通过Web页面直接调用Android原生app,并且把需要的参数通过Uri的形式,直接传递给app,节省用户的注册成本。简单的介绍DeepLink概念之后,我们看一个实际的例子:

朋友通过京东分享给我一个购物链接:

%title插图%num

于是我通过微信打开了这条链接:

%title插图%num

在微信中打开这个网址链接,提示我打开京东app,如果我点击了允许,就会打开我手机中的京东app,并且跳转到这个商品的详情页:

%title插图%num

通过这种形式,我可以快速的找到需要查看的商品,并且完成购买相关的操作。是不是非常方便,这就是DeepLink。

正文

这么流弊的DeepLink是不是非常的难?其实DeepLink的基本实现是简单到不可思议,他的核心思想实际上是Android的隐式启动。我们平时的隐式启动主要是通过Action和Category配合启动指定类型的Activity:

  1. <activity
  2. android:name=“.SecondActivity”
  3. android:exported=“true”>
  4. <intent-filter>
  5. <action android:name=“com.lzp.deeplinkdemo.SECOND” />
  6. <category android:name=“android.intent.category.DEFAULT” />
  7. </intent-filter>
  8. </activity>
  1. val intent = Intent(“com.lzp.deeplinkdemo.SECOND”)
  2. intent.addCategory(Intent.CATEGORY_DEFAULT)
  3. startActivity(intent)

除了action和category,还有一种隐式启动的用法是配置data:

  1. <data
  2. android:scheme=“xxxx”
  3. android:host=“xxxx”
  4. android:port=“xxxx”
  5. android:path=“xxxx”
  6. android:pathPattern=“xxxx”
  7. android:pathPrefix=“xxxx”
  8. android:mimeType=“xxxx”/>

scheme:协议类型,我们可以自定义,一般是项目或公司缩写,String

host:域名地址,String

port:端口,int。

path:访问的路径,String

pathPrefix:访问的路径的前缀,String

pathPattern:访问路径的匹配格式,相对于path和pathPrefix更为灵活,String

mimeType:资源类型,例如常见的:video/*, image/png, text/plain。

通过这几个配置项,我们发现data实际上为当前的页面绑定了一个Uri地址,这样就可以通过Uri直接打开这个Activity。

复习一下Uri的结构:

<scheme> :// <host> : <port> / [ <path> | <pathPrefix> | <pathPattern> ]

示例:https://zhidao.baidu.com/question/2012197558423339788.html

scheme和host不可缺省,否则配置无效;path,pathPrefix,pathPattern一般指定一个就可以了,pathPattern与host不可同时使用;mimeType可以不设置,如果设置了,跳转的时候必须加上mimeType,否则不能匹配到Activity。

现在我们修改SecondActivity的intent-filer:

  1. <activity
  2. android:name=“.SecondActivity”
  3. android:exported=“true”>
  4. <intent-filter>
  5. <action android:name=“com.lzp.deeplinkdemo.SECOND” />
  6. <category android:name=“android.intent.category.DEFAULT” />
  7. </intent-filter>
  8. <intent-filter>
  9. <data
  10. android:scheme=“lzp”
  11. android:host=“demo”
  12. android:port=“8888”
  13. android:path=“/second”
  14. android:pathPattern=“/second”
  15. android:pathPrefix=“/second”
  16. android:mimeType=“text/plain”/>
  17. </intent-filter>
  18. </activity>

打开SecondActivity:

  1. val intent = Intent()
  2. intent.setDataAndType(Uri.parse(“lzp://demo:8888/second”), “text/plain”)
  3. startActivity(intent)

现在在App中已经可以打开页面了,那么用web能不能正常打开呢?首先配置MainActivity的intent-filter:

  1. <activity
  2. android:name=“.MainActivity”
  3. android:exported=“true”>
  4. <intent-filter>
  5. <action android:name=“android.intent.action.MAIN” />
  6. <category android:name=“android.intent.category.LAUNCHER” />
  7. </intent-filter>
  8. <intent-filter>
  9. <data
  10. android:scheme=“lzp”
  11. android:host=“demo”
  12. android:path=“/main”/>
  13. </intent-filter>
  14. </activity>

Web需要打开url链接,所以我们不需要配置mimeType,

手写一个简单的Html页面:

  1. <!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>
  2. <html>
  3. <head>
  4. <meta http-equiv=“Content-Type” content=“text/html; charset=utf-8”>
  5. <meta http-equiv=“Content-Style-Type” content=“text/css”>
  6. <title></title>
  7. <meta name=“Generator” content=“Cocoa HTML Writer”>
  8. <meta name=“CocoaVersion” content=“1561.4”>
  9. <style type=“text/css”>
  10. p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 12.0px ‘Songti SC’; color: #000000; -webkit-text-stroke: #000000; min-height: 17.0px}
  11. span.s1 {font-kerning: none}
  12. </style>
  13. </head>
  14. <body>
  15. <a href=“lzp://demo/main”>打开main</a>
  16. </html>

Html页面添加了一个链接,点击打开lzp://demo/main这个地址。把html导入到手机中,用浏览器打开,点击“打开app”,毫无反应!!!

没错,如果只是配置了data,Web还是没办法通过url地址打开我们的Activity,那怎么解决这个问题呢?

  1. /**
  2. * Activities that can be safely invoked from a browser must support this
  3. * category. For example, if the user is viewing a web page or an e-mail
  4. * and clicks on a link in the text, the Intent generated execute that
  5. * link will require the BROWSABLE category, so that only activities
  6. * supporting this category will be considered as possible actions. By
  7. * supporting this category, you are promising that there is nothing
  8. * damaging (without user intervention) that can happen by invoking any
  9. * matching Intent.
  10. */
  11. @SdkConstant(SdkConstantType.INTENT_CATEGORY)
  12. public static final String CATEGORY_BROWSABLE = “android.intent.category.BROWSABLE”;

我们还需要配置:

<category android:name="android.intent.category.BROWSABLE" />

从官方的注释上写明:需要浏览器打开Activity,需要设置这个分类。例如邮件,只有设置了这个分类的Activity才会考虑被打开。加上这个配置后,再次点击看看有没有效果。

如果你真的亲自尝试了,你会发现还是没有效果。这个时候我们需要回顾一下action和category的用法:

首先需要尝试匹配action,action匹配成功了之后,才会继续匹配设置的category,所以单独匹配category是没有任何效果的。

因为我们要打开的仅仅是一个页面,所以我们设置:

  1. /**
  2. * Activity Action: Display the data to the user. This is the most common
  3. * action performed on data — it is the generic action you can use on
  4. * a piece of data to get the most reasonable thing to occur. For example,
  5. * when used on a contacts entry it will view the entry; when used on a
  6. * mailto: URI it will bring up a compose window filled with the information
  7. * supplied by the URI; when used with a tel: URI it will invoke the
  8. * dialer.
  9. * <p>Input: {@link #getData} is URI from which to retrieve data.
  10. * <p>Output: nothing.
  11. */
  12. @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
  13. public static final String ACTION_VIEW = “android.intent.action.VIEW”;

官方的注释说明ACTION_VIEW表示展示数据的页面,系统默认的Action就是ACTION_VIEW。添加上ACTION_VIEW,再次点击打开app。

还是不行,但是跟之前不同的是,这次出现了启动app的提示窗口,但是app却闪退了,看一下崩溃日志:

  1. 0906 14:35:15.459 12163270/? W/IntentResolver: resolveIntent failed: found match, but none with CATEGORY_DEFAULT
  2. 0906 14:35:15.473 2670826708/? E/AKAD: thread:Thread[main,5,main]
  3. android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=lzp://demo/main?id=111 flg=0x10000000 (has extras) }
  4. at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1805)
  5. at android.app.Activity.startActivityIfNeeded(Activity.java:4420)
  6. at android.app.Activity.startActivityIfNeeded(Activity.java:4367)
  7. at org.chromium.chrome.browser.externalnav.ExternalNavigationDelegateImpl$3.onClick(ExternalNavigationDelegateImpl.java:239)
  8. at com.qihoo.browser.dialog.CustomDialog$3.onClick(CustomDialog.java:274)
  9. at android.view.View.performClick(View.java:5267)
  10. at android.view.View$PerformClick.run(View.java:21249)
  11. at android.os.Handler.handleCallback(Handler.java:739)
  12. at android.os.Handler.dispatchMessage(Handler.java:95)
  13. at android.os.Looper.loop(Looper.java:148)
  14. at android.app.ActivityThread.main(ActivityThread.java:5541)
  15. at java.lang.reflect.Method.invoke(Native Method)
  16. at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
  17. at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)

日志上写的很明确,虽然找到了匹配的页面,但是没有设置CATEGORY_DEFAULT。看来Web通过url来打开链接,必须要求设置CATEGORY_DEFAULT,添加上后,看一下我们完整的xml配置:

  1. <activity
  2. android:name=“.MainActivity”
  3. android:exported=“true”>
  4. <intent-filter>
  5. <action android:name=“android.intent.action.MAIN” />
  6. <category android:name=“android.intent.category.LAUNCHER” />
  7. </intent-filter>
  8. <intent-filter>
  9. <action android:name=“android.intent.action.VIEW” />
  10. <category android:name=“android.intent.category.DEFAULT” />
  11. <category android:name=“android.intent.category.BROWSABLE” />
  12. <data
  13. android:scheme=“lzp”
  14. android:host=“demo”
  15. android:path=“/main”/>
  16. </intent-filter>
  17. </activity>

*后看一下效果:

 

%title插图%num

那么如何在通过url给app传递参数呢?要实现这个也很简单,首先我们知道要想给url添加参数,直接在url后拼接key=value就可以了,例如:

http://www.baidu.com/s?wd=android

其中wd=android就是我们要添加的参数,现在假设我们需要为Activity传递一个参数id,我们就可以修改uri为:

lzp://demo/main?id=111

客户端接收key为id的参数的方法:

  1. if (intent != null && intent.data != null) {
  2. Log.e(“lzp”, intent.data.getQueryParameter(“id”))
  3. }

如果只是接收参数的话,客户端不需要进行任何修改,但是这里有一种情况,如果我们Activity必须传递id,如果不传递id不允许跳转怎么办呢?我们有两种办法解决这个问题:

1、在刚才的if语句增加else判断,当参数为空的时候,进行finish操作。

2、通过pathPattern,通过通配符设置必须有参数。

我们看一下第二种的实现方式:

  1. <data
  2. android:pathPattern=“lzp://demo/main?id=*”
  3. android:scheme=“lzp” />

之前已经说过,pathPattern不能和host同时使用,所以我们只能删除host,pathPattern匹配的是整个Uri,这样我们还可以指定多个参数。但是AndroidManifest.xml会报错,我们忽略就可以了

总结

其实DeepLink的实现原理就是这么简单,只是我们对于隐式启动理解的不够。是不是也想给自己的App加上DeepLink呢?赶快尝试一下吧~

 

Android Deeplink配置

Deeplink启动应用配置注意事项
1. Deeplink格式说明
Deeplink是目前使用广告跟踪非常热门的一种方式,Deeplink的链接类型一般是schema://host/path?params样式。

2. 为接收Deeplink配置intent-filter
在Android设备中,点击Deeplink后可以打开指定应用,为了能够正确定位到需要打开的应用,并正确打开指定的Activity,需要应用开发过程中对Intent进行过滤接收进行配置(就是intent-filter),具体做法是在AndroidManifest.xml中对Activity声明的时候添加<intent-filter>的<data>节点,配置schema和一些必要的区分属性参数(如:host、path等)即可,配置的属性参数越多越详细,越能保证唯一性,准确打开需要打开的应用,而不是弹出打开应用选择框。

<intent-filter>标签包含以下属性

动作:外部打开必须配置成ACTION_VIEW,这样外部的打开指令才能到达;
范畴:必须包含DEFAULT,这个category允许你的Activity可以接收隐式Intent,如果没有配置这个,Activity只能通过指定应用程序容器名称打开;也必须包含BROWSABLE,这个category允许你的intent-filter可以在Web浏览器中访问,如果没有配置这个,点击Web浏览器中的Deeplink链接将无法解析并打开Activity;
数据:需要添加一个或者多个<data>标签,每一个<data>标签都描述了什么样格式的URI将会分派到Activity进行处理。每一个<data>标签至少且必须包含一个android:schema属性。
你可以添加更多的属性来提高Activity所能接收的URI类型的精准度。举个例子:你的应用会在多个activity中接收类似的URI(相同的schema和host),但这些URI根据有这不同的路径(path),在这种情况下,使用android:path属性,或者使用路径正则表达式(pathPattern)和路径前缀(pathPrefix)变种来区分对于不同的路径,系统需要打开哪个Activity。
测试的Deeplink链接:rsdkdemo://rs.com/test?referer=Deeplink_Test

Activity的配置intent-filter如下:

<activity
android:name=”com.rastargame.sdk.oversea.demo.RSDemoActivity”
android:configChanges=”orientation|keyboardHidden|navigation|screenSize”
android:launchMode=”singleTop”
android:screenOrientation=”sensor”
android:theme=”@android:style/Theme.Holo.Light.NoActionBar.Fullscreen”>
<intent-filter>
<action android:name=”android.intent.action.MAIN” />
<category android:name=”android.intent.category.LAUNCHER” />
</intent-filter>
<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=”rsdkdemo”
android:host=”rs.com”
android:pathPrefix=”/test”/>
</intent-filter>
</activity>

说明:
1.<data>中的属性参数配置必须要根据Deeplink来配置,尽可能配置更多属性参数保证唯一,否则点击deeplink连接会出现选择打开应用页面。
2.如果需要在浏览器中也能打开应用,需要在intent-filter中添加<category android:name=”android.intent.category.BROWSABLE” />这个配置(这个属性的含义就是在特定的情况下,可以在浏览器中打开Activity)

3. intent-filter配置注意事项
在有<action android:name=”android.intent.action.MAIN” />的<intent-filter>中添加<data>标签配置会无法通过Deeplink正确打开相应页面。一个Activity是可以有多个<intent-filter>标签,所以添加另外的<intent-filter>标签进行配置;
<category android:name=”android.intent.category.LAUNCHER” />和<category android:name=”android.intent.category.DEFAULT” />两个是相互冲突的,同时添加这两个category会导致桌面图标无法显示的问题;
说明:如果你添加<intent-filter>的Activity不包含android.intent.action.MAIN的<action>标签,就无需配置多个intent-filter。

4. Deeplink数据解析
点击Deeplink打开应用的时候,会将Deeplink传入到应用,应用在Activity的onCreate和onNewIntent对数据就进行处理。

5. Deeplink测试
5.1 命令行adb测试deeplink
直接使用命令行adb测试deeplink,使用命令:

adb shell am start -a android.intent.action.VIEW -d “rsdkdemo://rs.com/test?referer=Deeplink_Test”
1
5.2 测试网页点击deeplink
首先,需要编写一个简单的html文件,保存为test.html,html文件内容如下:
<!DOCTYPE html>
<head>
<meta charset=”UTF-8″ />
<meta id=”viewport” name=”viewport” content=”width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,minimal-ui”>
</head>
<html>
<input type=”button” value=”点击我打开Deeplink” onclick=”javascrtpt:window.location.href=’rsdkdemo://rs.com/test?referer=Deeplink_Test'”>
</html>

然后将html文件拷贝到设备中,使用浏览器打开,点击按钮即可打开应用。
5.3 测试Facebook deeplink
测试Facebook deeplink需要集成Facebook SDK,然后完成相应的配置,然后通过广告助手测试DeepLinked,测试设备上必须安装了Facebook客户端,并且登录了开发者账号对应的Facebook账号。