gpt4 book ai didi

ios - 环球银行金融电信协会 :- Universal linking in swift is not working

转载 作者:行者123 更新时间:2023-11-29 05:38:00 24 4
gpt4 key购买 nike

我在我的项目中使用通用链接。

我已经在服务器中制作了 apple-app-site-association 文件。

我在开发者帐户中启用了关联域的 Xcode,并且我编写了

应用链接:www.laundry.com

AppDelegate中使用的代码是:-

//Universal links in swift delegatemethod.
func application(_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([Any]?) -> Void) -> Bool
{
if userActivity.activityType == NSUserActivityTypeBrowsingWeb {
let url = userActivity.webpageURL!
let userurl = url.absoluteString
// print(url.absoluteString)
//handle url
if defaultValues.value(forKey: accessToken) != nil
{
print("user url is:",userurl)
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Pickup", bundle: nil)

let innerPage: PickupController = mainStoryboard.instantiateViewController(withIdentifier: "PickupController") as! PickupController
innerPage.selectedfrom = "Deeplink"
self.window?.rootViewController = innerPage
}else{
setRootControllerBeforeLogin()
}
}
return true
}

但它不起作用,请帮助我。

最佳答案

我曾经使用过firebase的动态链接,并覆盖了appDelegate中的另一个函数,如下所示。

func application(_ application:UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any]) -> Bool {
print("I have received a URL through custom url scheme : \(url.absoluteString)")
// tot do with dynamic link....
if let dynamicLink = DynamicLinks.dynamicLinks().dynamicLink(fromCustomSchemeURL: url) {

return true
} else {
// handle others like twitter or facebook login
}

}

关于ios - 环球银行金融电信协会 :- Universal linking in swift is not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56845466/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com