Universal Links (apple-app-site-association文件說明)

一闪朱、示例:
{
  "applinks": {
      "substitutionVariables": {
          "food": [ "burrito", "pizza", "sushi", "samosa" ]
       },
      "details": [
           {
             "appIDs": [ "ABCDE12345.com.example.app", "ABCDE12345.com.example.app2" ],
             "components": [
               { 
                  "/" : "/$(lang)_$(region)/$(food)/"
               },
               {
                  "#": "no_universal_links",
                  "exclude": true,
                  "comment": "Matches any URL whose fragment equals no_universal_links and instructs the system not to open it as a universal link"
               },
               {
                  "/": "/buy/*",
                  "comment": "Matches any URL whose path starts with /buy/"
               },
               {
                  "/": "/buy/*",
                  "#": "my_great_product_123",
                  "comment": "Matches any URL whose path starts with /buy/ and fragment equals my_great_product_123, ignoring case"
               },
               {
                  "/": "/help/website/*",
                  "exclude": true,
                  "comment": "Matches any URL whose path starts with /help/website/ and instructs the system not to open it as a universal link"
               },
               {
                  "/": "/help/*",
                  "?": { "articleNumber": "????" },
                  "comment": "Matches any URL whose path starts with /help/ and which has a query item with name 'articleNumber' and a value of exactly 4 characters"
               }
             ],
             "defaults": { "caseSensitive": false, "percentEncoded": true }
           }
       ]
   },
   "webcredentials": {
      "apps": [ "ABCDE12345.com.example.app" ]
   },
    "appclips": {
        "apps": ["ABCED12345.com.example.MyApp.Clip"]
    }
}
二、各字段說明:

Services

Services include:

  • webcredentials
    Use this service for shared web credentials.
  • applinks
    Use this service for universal links.
  • activitycontinuation
    Use this service for Handoff.
  • appclips
    Use this service for an App Clip.

applinks

  • defaults iOS 14.0+
    The global pattern-matching settings to use as defaults for all universal links in the domain.
  • details iOS 9.0+
    An array of Details objects that define the apps and the universal links they handle for the domain.
  • substitutionVariables iOS 13.5+
    Custom variables to use for simplifying complex pattern matches. Each name acts as a variable that the system replaces with each string in the associated string array.

applinks.Defaults

  • caseSensitive boolean
    A Boolean value that indicates whether pattern matching is case-sensitive. The default is true.
  • percentEncoded boolean
    A Boolean value that indicates whether URLs are percent-encoded. The default is true.

applinks.Details

  • appIDs [string]
    An array of application identifiers that specify the apps that can handle the universal links in the components array.
  • components applinks.Details.Components
    An array of components that define the universal link URLs an app can handle.
  • defaults applinks.Defaults
    A dictionary for defining the default settings to use for all universal links pattern matching in the components array.

applinks.AppIDs

Use appIDs to specify the apps that can access the specific URLs you define in the associated components array. You specify the application identifiers in the following format:
<Application Identifier Prefix>.<Bundle Identifier>

applinks.Details.Components

  • / string
    The pattern to match with the URL path component. The default is *, which matches everything.
  • ? * string, applinks.Details.Components.Query
    The pattern or dictionary to match with the URL query component. The default is *, which matches everything.
  • # string
    The pattern to match with the URL fragment component. The default is *, which matches everything.
  • exclude boolean
    A Boolean value that indicates whether to stop pattern matching and prevent the universal link from opening if the URL matches the associated pattern. The default is false.
  • comment string
    Text that the system ignores. Use this to provide information about the URLs a pattern matches.
  • caseSensitive boolean
    A Boolean value that indicates whether pattern matching is case-sensitive. The default is true.
  • percentEncoded boolean
    A Boolean value that indicates whether URLs are percent-encoded. The default is true.

applinks.Details.Components.Query

  • Any Key string
    The pattern to match with the specified NSURLQueryItem name.

applinks.SubstitutionVariables

  • Any Key [string]
    An array of strings to substitute for the associated variable in URL pattern-matching operations.

參考:
Support Universal Links
Supporting Associated Domains
Associated Domains Entitlement
applinks

?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
  • 序言:七十年代末捐川,一起剝皮案震驚了整個濱河市脓鹃,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌古沥,老刑警劉巖瘸右,帶你破解...
    沈念sama閱讀 217,826評論 6 506
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異岩齿,居然都是意外死亡太颤,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,968評論 3 395
  • 文/潘曉璐 我一進店門盹沈,熙熙樓的掌柜王于貴愁眉苦臉地迎上來龄章,“玉大人,你說我怎么就攤上這事乞封∽鋈梗” “怎么了?”我有些...
    開封第一講書人閱讀 164,234評論 0 354
  • 文/不壞的土叔 我叫張陵肃晚,是天一觀的道長锚贱。 經(jīng)常有香客問我,道長陷揪,這世上最難降的妖魔是什么惋鸥? 我笑而不...
    開封第一講書人閱讀 58,562評論 1 293
  • 正文 為了忘掉前任,我火速辦了婚禮悍缠,結果婚禮上卦绣,老公的妹妹穿的比我還像新娘。我一直安慰自己飞蚓,他們只是感情好滤港,可當我...
    茶點故事閱讀 67,611評論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著趴拧,像睡著了一般溅漾。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上著榴,一...
    開封第一講書人閱讀 51,482評論 1 302
  • 那天添履,我揣著相機與錄音,去河邊找鬼脑又。 笑死暮胧,一個胖子當著我的面吹牛锐借,可吹牛的內容都是我干的。 我是一名探鬼主播往衷,決...
    沈念sama閱讀 40,271評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼钞翔,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了席舍?” 一聲冷哼從身側響起布轿,我...
    開封第一講書人閱讀 39,166評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎来颤,沒想到半個月后汰扭,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,608評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡脚曾,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 37,814評論 3 336
  • 正文 我和宋清朗相戀三年东且,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片本讥。...
    茶點故事閱讀 39,926評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡珊泳,死狀恐怖,靈堂內的尸體忽然破棺而出拷沸,到底是詐尸還是另有隱情色查,我是刑警寧澤,帶...
    沈念sama閱讀 35,644評論 5 346
  • 正文 年R本政府宣布撞芍,位于F島的核電站秧了,受9級特大地震影響,放射性物質發(fā)生泄漏序无。R本人自食惡果不足惜验毡,卻給世界環(huán)境...
    茶點故事閱讀 41,249評論 3 329
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望帝嗡。 院中可真熱鬧晶通,春花似錦、人聲如沸哟玷。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,866評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽巢寡。三九已至喉脖,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間抑月,已是汗流浹背树叽。 一陣腳步聲響...
    開封第一講書人閱讀 32,991評論 1 269
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留谦絮,地道東北人题诵。 一個月前我還...
    沈念sama閱讀 48,063評論 3 370
  • 正文 我出身青樓须误,卻偏偏與公主長得像,于是被迫代替她去往敵國和親仇轻。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 44,871評論 2 354

推薦閱讀更多精彩內容