iOS9上的Universal Link實現

來源:互聯網
上載者:User

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進行簽名。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.