<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Johnny on Medium]]></title>
        <description><![CDATA[Stories by Johnny on Medium]]></description>
        <link>https://medium.com/@johnny_92831?source=rss-c94cafa1590a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SugevgXgY9Vskx_D</url>
            <title>Stories by Johnny on Medium</title>
            <link>https://medium.com/@johnny_92831?source=rss-c94cafa1590a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 06:41:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@johnny_92831/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Introducing Swift Macro]]></title>
            <link>https://medium.com/dcardlab/introducing-swift-macro-175a8b80f5ed?source=rss-c94cafa1590a------2</link>
            <guid isPermaLink="false">https://medium.com/p/175a8b80f5ed</guid>
            <dc:creator><![CDATA[Johnny]]></dc:creator>
            <pubDate>Tue, 24 Oct 2023 09:48:19 GMT</pubDate>
            <atom:updated>2023-10-24T09:48:19.074Z</atom:updated>
            <content:encoded><![CDATA[<p>Swift 5.9 推出了一個功能叫做「Macro」，本篇文章將簡單介紹：</p><ol><li>什麼是 Macro？</li><li>Macro 可以為我們帶來什麼好處？</li><li>Macro 如何運作？</li><li>解讀 Macro 程式碼</li></ol><p>並附上 Dcard 已經開源的 Macro 當作範例，一步一步帶大家走進 Macro 的世界</p><h3>什麼是 Macro？</h3><p>Macro 是 Swift 5.9 推出的新功能，根據蘋果官方的文件</p><blockquote>Swift macros help you avoid writing repetitive code in Swift by generating that part of your source code at compile time.</blockquote><p>簡單的來說，Macro 可以</p><blockquote><em>幫你產生程式碼，省下做重複工作的時間</em></blockquote><h3>Macro 可以為我們帶來什麼好處？</h3><p>你可能有寫過類似 code 的經驗，通常都是在打 API，要傳入變數時會發生</p><pre>let type: String = &quot;foo&quot;<br>let offset: Int = 30<br>let parameters = [&quot;type&quot;: type, &quot;offset&quot;: offset]<br>// Send request to API..</pre><p>不知道你覺得這樣的 code 有什麼問題呢？<br>嚴格上來說沒有問題，只是有許多重複的 code：</p><pre>[&quot;type&quot;: type, &quot;offset&quot;: offset]</pre><p>我們暫時抽離 Swift，你知道這段 Javascript 代表什麼意思嗎？</p><pre>const type = &quot;foo&quot;<br>const offset = 30<br>const parameters = { type, offset }</pre><p>這段 code 代表</p><blockquote><em>定義一個 Dictionary，Key 的名稱跟變數名稱一樣，Value 則是變數本身的值</em></blockquote><p>讓我們來看看實際執行的結果：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*tIzkMb6cpDv71MKoT1pDZA.png" /><figcaption>Execution result of javascript code</figcaption></figure><p>我們可以省下自己定義 key 名稱的時間，讓 Javascript 來幫我們做這件事<br>而 Swift 沒有類似 Javascript 的特性，Swift 並不支援像 Javascript 這樣定義一個 Dictionary。你必須將 Key &amp; Value 一個一個寫出來</p><h3>Introducing Macro!</h3><p>如果我們真的想要像 Javascript 一樣定義一個 Dictionary 怎麼辦？<br>以往是不可能的，但我們現在有 Macro，可以輕易做到這件事<br>我們開源了一個 Swift Macro 來完成這件事：<a href="https://github.com/Dcard/DictionaryLiteralShorthandMacro">DictionaryLiteralShorthandMacro</a></p><h4>示範</h4><pre>import DictionaryLiteralShorthand<br><br>let offset = 30<br>let type = &quot;foo&quot;<br>let dictionary: [AnyHashable: Any] = #dictionaryLiteralShorthand(offset, type)</pre><p>這段 code 在被 Macro 處理過後，<strong>等同於</strong>這段程式碼：</p><pre>import DictionaryLiteralShorthand<br><br>let offset = 30<br>let type = &quot;foo&quot;<br>let dictionary: [AnyHashable: Any] = [&quot;offset&quot;: offset, &quot;type&quot;: type]</pre><p>可以讓我們達成跟 Javascript 一樣的事情，不用再辛苦手寫每個 Key、Value 的名稱了！</p><h3>發生了什麼事？</h3><p>Macro 的運作原理，是將你的原始碼送到 Macro「處理」過後，把 Macro 「展開」來，插入到原本的程式碼裡面</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RGGNwekIY3nR2rLZg9cF_Q.png" /><figcaption>How macro works, photo taken from: <a href="https://docs.swift.org/swift-book/documentation/the-swift-programming-language/macros/">https://docs.swift.org/swift-book/documentation/the-swift-programming-language/macros/</a></figcaption></figure><p>以上面的例子來說，本來是這樣：</p><pre>let dictionary: [AnyHashable: Any] = #dictionaryLiteralShorthand(offset, type)</pre><p>送到 Macro 處理後，實際上會變成這樣：</p><pre>let dictionary: [AnyHashable: Any] = [&quot;offset&quot;: offset, &quot;type&quot;: type]</pre><p>也就是說</p><blockquote><em>最終送到 Compiler 編譯的程式碼，實際上是第二段被「展開」後的程式，不是第一段！</em></blockquote><h3>解讀 DictionaryLiteralShorthand 原始碼</h3><p>本段將簡單介紹我們的 Macro 是如何自動幫你產生 Dictionary 程式碼</p><p><em>PS. 我們就不從頭開始教學怎麼建立一個 Macro，有興趣的人可以參考下方 References，Apple 有提供非常詳盡的教學！</em></p><h4>1. 定義 Macro</h4><p><a href="https://github.com/Dcard/DictionaryLiteralShorthandMacro/blob/main/Sources/DictionaryLiteralShorthand/DictionaryLiteralShorthand.swift">DictionaryLiteralShorthand.swift</a> 檔案裡定義了 Macro</p><pre>@freestanding(expression)<br>public macro dictionaryLiteralShorthand(_ value: Any...) -&gt; [AnyHashable: Any] = #externalMacro(module: &quot;DictionaryLiteralShorthandMacros&quot;, type: &quot;DictionaryLiteralShorthandMacro&quot;)</pre><ul><li><em>dictionaryLiteralShorthand</em> 是 Macro 的名稱，跟平常定義 function 名稱時一樣，使用的人會呼叫 #<em>dictionaryLiteralShorthand </em>來使用 Macro</li><li>而 <em>_ value: Any </em>則代表可以傳入 Macro 的型別為 Any。因為 Dictionary 的 Value 可以是 Any，所以 Macro 本身當然也接受 Any 當作傳入的值</li><li>三個點 <em>… </em>是 <a href="https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Variadic-Parameters">Variadic Parameters</a>，接在 <em>Any </em>後面，代表<em>允許傳入 0 或無限個 Any 變數（每個變數用逗號分隔）</em></li><li>我們最終的目的是希望幫開發者產生出一段定義 Dictionary 的程式碼，所以 Macro 的回傳值當然就是 <em>[AnyHashable: Any] </em>囉！</li></ul><h4>2. 額外知識 — Abstract Syntax Tree</h4><p>在往下講解前，我想要先簡單帶過 <a href="https://en.wikipedia.org/wiki/Abstract_syntax_tree"><strong>Abstract Syntax Tree</strong></a>，又稱作 — <em>AST</em></p><blockquote>AST 是一種用來表示程式原始碼的資料結構</blockquote><p>舉例來說，常用的 <a href="https://swiftpackageindex.com/apple/swift-syntax/508.0.1/documentation/swiftsyntax/stringliteralexprsyntax">String literal</a> 在 Swift AST 裡面是 <a href="https://swiftpackageindex.com/apple/swift-syntax/508.0.1/documentation/swiftsyntax/stringliteralexprsyntax"><em>StringLiteralExprSyntax</em></a></p><p>AST 的用途很多，很常見的例子就是 <em>linting，</em>可以用來檢查程式碼有沒有符合我們定下的規範，<a href="https://github.com/realm/SwiftLint">SwiftLint</a><em> </em>就是用 <em>AST</em> 來實作 linting 的</p><p>而 Macro 做的事正是：</p><blockquote>先將原始碼轉換為 AST ，再根據不同 macro 的實作，產生一個新的 AST，給 Macro 轉換成另一段原始碼</blockquote><ul><li>Swift 的 AST 實作是由 Apple 推出的 <a href="https://github.com/apple/swift-syntax">SwiftSyntax </a>實作</li><li><a href="https://swiftpackageindex.com/apple/swift-syntax/508.0.1/documentation/swiftsyntax">SwiftSyntax 官方 Document</a></li></ul><h4>3. Macro 的核心</h4><p><a href="https://github.com/Dcard/DictionaryLiteralShorthandMacro/blob/main/Sources/DictionaryLiteralShorthandMacros/DictionaryLiteralShorthandMacro.swift">DictionaryLiteralShorthandMacro.swift</a> 裡則是最核心的部分，裡面定義了 Macro 該如何「展開」成另一段程式碼！你可以先打開程式碼，再聽我一段一段解說</p><pre>public static func expansion(<br>        of node: some FreestandingMacroExpansionSyntax,<br>        in context: some MacroExpansionContext<br>    ) throws -&gt; ExprSyntax {</pre><p>這段 function 是由 <em>ExpressionMacro</em> protocol 所定義，原始碼會被轉換成 AST 後，透過這個 function 傳進來，處理後再回傳一個新的 AST</p><pre>guard !node.argumentList.isEmpty else {<br>    let diagnose: Diagnostic = Diagnostic(<br>        node: node._syntaxNode,<br>        message: DictionaryLiteralShorthandMacroError.emptyInput<br>    )<br>    context.diagnose(diagnose)<br>    throw DiagnosticsError(diagnostics: [diagnose])<br>}</pre><p>這邊則是要檢查是否有變數傳入 Macro，若沒有，則讓編譯器報錯</p><p>因為 <a href="https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Variadic-Parameters">Variadic Parameters</a> 允許傳入 0 個變數，因此 #dictionaryLiteralShorthand() 這種寫法是可以成功編譯的</p><p>雖然可以成功編譯，但傳入 0 個變數實際上沒有意義，因此我想要藉由讓編譯器報錯來提醒開發者不要寫這樣的程式碼</p><pre>guard element.expression.is(IdentifierExprSyntax.self) else {<br>    let diagnose: Diagnostic = Diagnostic(<br>        node: element._syntaxNode,<br>        message: DictionaryLiteralShorthandMacroError.acceptsOnlyIdentifierExpressionSyntax<br>    )<br>    context.diagnose(diagnose)<br>    throw DiagnosticsError(diagnostics: [diagnose])<br>}</pre><p>檢查傳入 Macro 的值是否都是 <em>IdentifierExprSyntax，</em>若不是則由 Compiler 報錯提醒使用者。下面這段程式碼的 foo 即為 <em>IdentifierExprSyntax</em></p><pre>let foo: String = &quot;Hello World&quot;<br>//  ^ This is an IdentifierExprSyntax</pre><p>但是為什麼我們要這樣做？來看看下面這段 code：</p><pre>let dict: [String: Any] = #dictionaryLiteralShorthand(&quot;Hello&quot;, 999)</pre><p>你覺得這段 code 可以達成我們的目標嗎？</p><blockquote><em>定義一個 Dictionary，Key 的名稱跟變數名稱一樣，Value 則是變數本身的值</em></blockquote><p>答案當然是不行，因為 &quot;Hello&quot; 跟 999 是 <em>String/Integer</em> literal，<em>它們沒有一個「名稱」可以放到 Dictionary 裡面當作 Key</em></p><p><em>IdentifierExprSyntax </em>這個 AST 才有一個「名稱」可以放到 Dictionary 當作 Key，因此這段檢查是非常重要的</p><pre>let idSyntax = element.expression.cast(IdentifierExprSyntax.self)<br>let identifierText: String = idSyntanx.identifier.text // Get the actual variable name from IdentifierExprSyntax<br><br>guard !usedExpressions.contains(identifierText) else {<br>    let diagnose: Diagnostic = Diagnostic(<br>        node: element._syntaxNode,<br>        message: DictionaryLiteralShorthandMacroError.duplicateIdentifiers<br>    )<br>    context.diagnose(diagnose)<br>    throw DiagnosticsError(diagnostics: [diagnose])<br>}</pre><p>本段用意為檢查傳入 Macro 的值是否重複，例如：</p><pre>let a = &quot;Foo&quot;<br>let b = &quot;Bar&quot;<br>let d = #dictionaryLiteralShorthand(a, a, a, b)</pre><p>不管傳入幾個 a，Dictionary 始終只會有一個 a 的 Key-Value pair，傳入多個重複的變數並沒有意義，因此若重複則讓 Compiler 報錯</p><pre>let trailingComma: TokenSyntax? = index == node.argumentList.count - 1 ? nil : .commaToken()<br>elements.append(<br>    DictionaryElementSyntax(<br>    keyExpression: StringLiteralExprSyntax(content: identifierText),<br>    valueExpression: idSyntanx,<br>    trailingComma: trailingComma<br>  )<br>)<br><br>usedExpressions.insert(identifierText)</pre><p>重頭戲來了！我們要開始產生 Dictionary 的程式碼</p><p><em>DictionaryElementSyntax </em>代表的是 Dictionary 內的 element，下圖可以幫助你理解它</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TYRUetaBXYow0hWiYRbA7Q.png" /><figcaption>Demonstration of <em>DictionaryElementSyntax</em></figcaption></figure><ul><li>keyExpression 是 Dictionary 中的 Key，我們給賦予它：<em>跟變數名稱一樣的 String literal</em></li><li>valueExpression 是 Dictionary 中的 Value，我們賦予它：目前在 for-loop 中存取到的 <em>IdentifierExprSyntax</em></li><li>trailingComma 則是決定要不要有「逗號」來分隔不同 element。最後一個 element 不需要逗號，因此最後一個傳入 nil，其他都傳入 commaToken() 來分隔</li></ul><pre>let dictionaryLiteral = DictionaryExprSyntax(<br>  content: .elements(DictionaryElementListSyntax(elements))<br>)<br><br>return ExprSyntax(dictionaryLiteral)</pre><p><em>DictionaryExprSyntax </em>代表的則是整個 Dictionary 的 AST</p><p>最後將所有的 <em>DictionaryElementSyntax </em>傳入 <em>DictionaryExprSyntax</em>，再 return 給 function，就大功告成了！</p><h3>備註</h3><p>想入門寫 Macro 的人，我非常推薦 <a href="https://swift-ast-explorer.com/">Swift AST Explorer</a> 這個線上工具，你可以用它來看程式碼對應的 AST 是什麼，再去查文件，對提升開發效率非常有幫助！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bxXdkYDkOl1k--SdLV4pvQ.png" /><figcaption>A photo of Swift AST Explorer</figcaption></figure><h3>References</h3><p>Apple 官方提供了許多 Macro 相關的資源，非常推薦想入門自己寫一個 Macro 的人看看！</p><ul><li><a href="https://docs.swift.org/swift-book/documentation/the-swift-programming-language/macros/">https://docs.swift.org/swift-book/documentation/the-swift-programming-language/macros/</a></li><li><a href="https://developer.apple.com/documentation/Swift/applying-macros">https://developer.apple.com/documentation/Swift/applying-macros</a></li><li><a href="https://developer.apple.com/videos/play/wwdc2023/10166/">https://developer.apple.com/videos/play/wwdc2023/10166/</a></li><li><a href="https://developer.apple.com/videos/play/wwdc2023/10167/">https://developer.apple.com/videos/play/wwdc2023/10167/</a></li><li><a href="https://swift-ast-explorer.com/">Swift AST Explorer</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=175a8b80f5ed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dcardlab/introducing-swift-macro-175a8b80f5ed">Introducing Swift Macro</a> was originally published in <a href="https://medium.com/dcardlab">Dcard Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Universal Link 的奇幻旅程]]></title>
            <link>https://medium.com/dcardlab/universal-link-%E7%9A%84%E5%A5%87%E5%B9%BB%E6%97%85%E7%A8%8B-fade4088c820?source=rss-c94cafa1590a------2</link>
            <guid isPermaLink="false">https://medium.com/p/fade4088c820</guid>
            <dc:creator><![CDATA[Johnny]]></dc:creator>
            <pubDate>Wed, 17 May 2023 16:49:07 GMT</pubDate>
            <atom:updated>2023-05-17T16:49:07.271Z</atom:updated>
            <content:encoded><![CDATA[<p>Universal Link 是一個令開發者又愛又恨的東西，它可以增進使用者體驗，但出問題時卻很難 Debug</p><p>今天要分享我們遇到 Universal Link 出錯時，一步一步除錯並解決問題的過程，並分享一些簡單的 Debug 方式</p><h4>什麼是 Universal Link？</h4><blockquote>iOS 的 Universal Link 是一種網頁連結的標準，可以讓開發者在網頁上放置特定格式的連結，並且在用戶點擊這些連結時，讓 iOS 裝置直接開啟對應的應用程式，而不是在瀏覽器中顯示該網頁。</blockquote><blockquote>- By ChatGPT</blockquote><p>關於 Universal Link 的使用方式以及運作原理網路上已有許多教學文章，本篇文章就不多加以解釋</p><h4>我們遇到什麼問題？</h4><ol><li>已經在 .well-known 資料夾底下放了 apple-app-site-association 檔案，Xcode 也已經設置 Associated Domain</li><li>點擊網址仍無法直接打開並跳轉到 App，只會開 Safari</li><li>設定 mode=developer 繞過 Apple CDN 後，<strong>卻可以正常打開 App</strong></li></ol><h4>什麼是 Apple 的 <a href="https://zh.wikipedia.org/zh-tw/%E5%85%A7%E5%AE%B9%E5%82%B3%E9%81%9E%E7%B6%B2%E8%B7%AF">CDN</a>？</h4><p>官方的<a href="https://developer.apple.com/documentation/Xcode/supporting-associated-domains?language=objc">技術文件</a>裡面有這麼幾段話</p><blockquote>Starting with macOS 11 and iOS 14, apps no longer send requests for <em>apple-app-site-association</em> files directly to your web server. Instead, they send these requests to an Apple-managed content delivery network (CDN) dedicated to associated domains.</blockquote><blockquote>Apple’s content delivery network requests the <em>apple-app-site-association</em> file for your domain within 24 hours. Devices check for updates approximately once per week after app installation.</blockquote><p>簡單來說：</p><ol><li>Apple 的 CDN 每 24 小時會去跟你的 Server 下載 apple-app-site-association 檔案</li><li>使用者的裝置會再跟 Apple 的 CDN 下載這個檔案</li><li>下載完後存在裝置上，大概 7 天會檢查一次更新</li></ol><p>在 Associated Domain 的 URL 設定 mode=developer 則可以<a href="https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_associated-domains?language=objc">繞過 Apple CDN</a>，直接從你的 Server 下載檔案。範例：</p><pre>applinks:www.dcard.tw?mode=developer</pre><h4>思路</h4><p>根據以上資訊，<em>因為繞過 CDN 可以正常打開 App</em>，我們可以確定的是：</p><ol><li>apple-app-site-association檔案設置正確</li><li>Associated Domain 設置正確</li></ol><p>因此得出以下推論：</p><ol><li>Apple CDN 沒抓到檔案</li><li>裝置沒透過 CDN 抓到檔案</li></ol><p>嘗試 Reset 模擬器，重新安裝 App 後仍然無法跳轉，算是間接驗證了不是 <strong>裝置沒透過 CDN 抓到檔案</strong> 的問題，那麼可能性只剩下 <strong>Apple CDN 沒抓到檔案</strong></p><p>Google 了一下後發現有一個網址可以檢測 Apple CDN 有沒有抓到你的 apple-app-site-association檔案</p><pre><a href="https://app-site-association.cdn-apple.com/a/v1/your.domain.name">https://app-site-association.cdn-apple.com/a/v1/your.domain.name</a></pre><p>把網址輸入上去後，得到 Not Found 的結果</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*qYgDiu0U7X-H_YEx9Gc_sA.png" /></figure><p>由於這個網址沒有正式的文件，抱著姑且一試的 Developer Console ，發現了有趣的東西</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y0RY-mu_oPgRYNbPLcOTdQ.jpeg" /></figure><p>其中一個 Response Header 出現了 <a href="https://developer.mozilla.org/zh-TW/docs/Web/HTTP/Status/403"><strong>403 Forbidden</strong></a> 的訊息，我的直覺告訴我可能是 Apple CDN 沒辦法正常存取我們的網站，為了近一步驗證回傳的訊息是可靠的</p><p>身為一個專業的前端，<em>亂戳看看 API 是一定要的，</em>輸入一個不存在的網址，回傳了 404 Not Found &amp; No Such Host 的訊息，間接證明了這個 API 回傳的 Header 是有規矩的，不是隨便亂傳，更加確信 Apple CDN 被我們的防火牆擋住了！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zH27Z9WECrLrQTRNBMqn3A.jpeg" /></figure><p>拿上圖出現的 SWCERR00101 Bad HTTP Response: 403 Forbidden 訊息去 Google 後，發現 <a href="https://developer.apple.com/forums/thread/706516">Apple 官方人員確實解答了</a>出現此錯誤訊息時，代表 Apple CDN 無法存取檔案</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nT9lyhKw1RGiwiKxVqC8gQ.png" /></figure><p>接下來問題就簡單啦！聯絡負責 Security 的同事，發現<strong>我們的防火牆的確把 Apple 的 Bot 擋住了！</strong></p><p>Apple 的 Bot 的 User-Agent 是：AASA-Bot/1.0.0</p><p>在解開防火牆限制後大約 30 分鐘，Universal Link 就正常運作了！🎉</p><p>希望本篇文章可以幫助到你！</p><h4>tl;dr，遇到 Universal Link 無法正常打開 App 時可以怎麼 Debug？</h4><ol><li>先檢查可不可以正常存取你 Server 上的 ./well-known/apple-app-site-association</li><li>若可以存取，請將 Xcode 中的 Associated Domain 設置為 mode=developer，再嘗試看看 (詳情請參閱<a href="https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_associated-domains?language=objc">官方文件</a>)。若無法打開，代表可能 apple-app-site-association 檔案或 Associated Domain 設置有誤</li><li>若可以打開，代表可能 Apple CDN 抓不到 apple-app-site-association 檔案，請使用以下網址，輸入你自己的 Domain Name 來檢查：</li></ol><pre><a href="https://app-site-association.cdn-apple.com/a/v1/your.domain.name">https://app-site-association.cdn-apple.com/a/v1/your.domain.name</a></pre><p>若運作正常，應該要出現你的 apple-app-site-association 檔案，範例：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9S5A1gOhPnsugTYxZpdYkA.png" /></figure><p>若無法顯示檔案內容，請檢查是不是你的 Server 把 Apple 的 Bot 擋住了，導致 Apple 無法存取檔案。</p><p>Apple 的 Bot 的 User-Agent 是：AASA-Bot/1.0.0</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fade4088c820" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dcardlab/universal-link-%E7%9A%84%E5%A5%87%E5%B9%BB%E6%97%85%E7%A8%8B-fade4088c820">Universal Link 的奇幻旅程</a> was originally published in <a href="https://medium.com/dcardlab">Dcard Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>