ios - 如何使用gmail模板链接进入移动应用程序
问题描述
嗨,在我的项目中,我们正在使用深度链接。
当用户点击电子邮件模板时,用户需要转到移动应用程序中的关注页面。
通过使用模板我得到这样的链接: TaptoSchedule://host/inner
但后端人员给出的链接如下: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
}
}
解决方案
您可能想使用 Universal Links 而不是 Deep Links。通用链接使用标准的 URL 格式,这似乎是您的后端团队为您提供的。
从客户的角度来看,深度链接和通用链接之间的体验基本相同。但是,通用链接为您提供了一些额外的灵活性。例如,通用链接使用标准 URL 格式,如果您的用户没有安装您的应用程序,它可以链接到网页。
在此处查看 Apple 文档以了解详细信息: https ://developer.apple.com/ios/universal-links/
推荐阅读
- python - Module object in callable in python - Atom.io as as Jupyter notebook
- mysql - 使用 jOOQ 跳过行的“Seek”分页
- c++ - 为什么程序会错过“if”运算符?
- elasticsearch - 弹性搜索标记字符
- javascript - 按月对对象数组进行排序
- php - 在 prestashop 1.6 中发送之前如何获取电子邮件内容
- python - IPython`显示`到字符串
- excel - 在 VBA 中删除/删除 Powerpoint 幻灯片标签
- c++ - 如何 push_back 到带有 getter 函数的列表?
- bash - 将具有扩展名的文件从目录的子目录移动到与另一个目录具有相同名称的另一个子目录