2017-03-09 73 views
0

我在我的HTTPS根目錄(kumpul.co.id/apple-app-site-association)中提供apple-app-site-association並且結果從https://branch.io/resources/aasa-validator/#resultsbox通用鏈接不適用於iOS 10.2

我已經在我的權利配置的:applinks:kumpul.co.id

,我已經把這個功能在我Appdelegate.swift:

func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool { 
    NSLog("Check Universal Link") 
    // 1 
    guard userActivity.activityType == NSUserActivityTypeBrowsingWeb, 
     let url = userActivity.webpageURL, 
     let components = URLComponents(url: url, resolvingAgainstBaseURL: true) else { 
      return false 
    } 
     print("url: \(url)") 
    print("component: \(components)") 

    // 2 
    if let match = MatchHandler.sharedInstance.items.filter({ $0.path == components.path}).first { 
     self.presentMatch(match) 
     return true 
    } 
    //3 
    let webpageUrl = URL(string: "http://www.kumpul.co.id")! 
    application.openURL(webpageUrl) 

    return false 
} 

對於路徑,我設置的「路徑「:[」/ match/*「],因爲鏈接爲kumpul.co.id/match/play_2.html例如

但是當我點擊我的鏈接上WhatsApp或線消息,此功能根本不會被調用,我看不到日誌時,我點擊鏈接。我在這裏做錯了什麼?

回答

1

行與Universal Links不兼容,因此測試用例無效。即使所有內容都配置完美,您的應用也無法打開,即使所有內容都完美配置(您需要使用號召性用語按鈕提供內容的網絡預覽,例如this - 存在同樣的問題on Facebook,順便一提)。

WhatsApp應該工作。如果您的應用程序甚至在單擊鏈接時未啓動,則會出現配置問題。您可以嘗試通過this page進行一些故障排除步驟。如果您的應用程序啓動,那麼你的配置是正確的,你應該確認裏面continue userActivity

+0

邏輯當我檢查我的鏈接(HTTPS://www.kumpul.co.id.match/play_70.html)上HTTPS ://search.developer.apple.com/appsearch-validation-tool/,它表示「錯誤沒有帶域名權利的應用程序 用於驗證深層鏈接雙重身份驗證的權利數據來自您當前的應用程序發佈版本。可能需要48小時才能更新。「 但是,從https://branch.io/resources/aasa-validator/#resultsbox,它通過了所有的驗證,這是怎麼發生的?我已將我的權利添加到我的項目中作爲applinks:kumpul.co.id –

+0

這是「App Search API驗證工具」,而不是「通用鏈接驗證工具」(Apple不存在)。這個工具的結果與Universal Links是否工作無關 –