我在应用程序中使用通用链接,为此,我制作了以下apple-app-site-association文件,就像下面的代码一样。
我将此文件放入服务器,请在这里找到:-http://dev.2ulaundry.com/apple-app-site-association
我还将域URL添加到相关域下的项目文件功能中。
但是我的通用链接无法正常运行,请给我帮助。
"applinks": {
"apps": [],
"details": [
{
"appID": "D929J2.com.apple.wwdc",
"paths": [ "/scheduled-pickups/","/new-schedule/", "dashboard-1", "/refer-a-friend/", "/price-list/", "/give-a-gift/", "/locations", "2u-rewards/", "payments/"]
}
]
}
}
并将以下代码也添加到appdelegate文件中,以进行哈希处理。
func application(_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([Any]?) -> Void) -> Bool
{
if userActivity.activityType == NSUserActivityTypeBrowsingWeb {
let url = userActivity.webpageURL!
let userurl = url.absoluteString
if userurl.contains("/scheduled-pickups/")
{
let innerPage = UIStoryboard.loadPickupController()
innerPage.selectedfrom = SelectedFromVc.Deeplinking.rawValue
let nav = UINavigationController.init(rootViewController: innerPage)
nav.isNavigationBarHidden = true
self.window?.rootViewController = nav
}
}
您应检查您的域对于使用通用链接有效。您可以在这里进行:https://branch.io/resources/aasa-validator/。
我已经检查了您的域http://dev.2ulaundry.com,并且您的域存在一些问题。修复它们,应该没问题。