您好,在我的项目中,我们正在使用深层链接。
当用户点击电子邮件模板时,用户需要转到移动应用中的关注页面。
通过使用模板我得到这样的链接: TaptoSchedule://主机/内部
但是后端人员给出的链接如下:https://www.laundry.com/new-schedule/
我们如何在 iOS 中获得此类功能,请与我分享任何想法。
我关注的是:http://swiftdeveloperblog.com/deep-linking-using-custom-url-scheme/
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
if defaultValues.value(forKey: accessToken) != nil{
let urlPath : String = url.path as String
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
//TaptoSchedule://host/inner
if(urlPath == "/inner"){
let innerPage: PickupController = mainStoryboard.instantiateViewController(withIdentifier: "PickupController") as! PickupController
innerPage.selectedfrom = "Deeplink"
self.window?.rootViewController = innerPage
} else if (urlPath == "/about"){
}
self.window?.makeKeyAndVisible()
return true
}else{
setRootControllerBeforeLogin()
return true
}
}
最佳答案
关于ios - 如何使用 Gmail 模板链接进入移动应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56746623/