1.Universal Link
理解為蘋果官方支援deeplink就行了
2.通過點擊HTTP連結啟動APP
Web・iOS應用在支援Universal Link的前提下,當使用者點擊特點的連結時會自己起動應用
・App已經安裝的前提下:直接啟動App然後現實連結內容
・App沒有安裝的前提下:Web上繼續顯示連結內容
3.Universal Link的實現方法
首先需要準備一下內容
Web伺服器
・獨立的domain
・SSL認證
・被簽名的JSON檔案
iOS應用
・iOS9以上
・Xcode 7・iOS 9 SDK
・Capabilities
・AppDelegate的代理設定
3.1 Capabilities的設定
在Capabilities的設定中,設定`Associated Domains’的Domains內容
例:https://www.facebook.com/ -> applinks:facebook.com
注意:對於subdomain,www的有無要仔細考慮一下
3.2 apple-app-site-association檔案的配置
apple-app-site-association檔案一定要放在伺服器的根目錄下。。。。。。
首先要準備一下apple-app-site-association檔案
| 1 2 3 4 5 6 7 8 9 10 |
{ "applinks" : { "apps" : [], "details" : { "TBEJCS6FFP.com.domain.App" : { "paths" :[ "*" ] } } } } |
paths中的內容為對應App啟動的連結路徑
全路徑的時候使用“*”。
特定位置的時候需要指定具體內容,
| 1 |
[ "/wwdc/news/" , /videos/wwdc/ 2015 /*] |
TBEJCS6FFP.com.domain.App這部分使用的是你的TeamID和Bundle Identifier
3.3 對apple-app-site-association檔案的簽名
我使用的是以下的方法對apple-app-site-association進行簽名。