问题描述
我正在我的 iOS 应用程序中开发重置密码功能。在请求重置密码页面,它将要求用户输入他们的电子邮件,重置密码链接将发送到他们的邮箱。当他们单击电子邮件中的“重置密码链接”时,应该将他们链接回重置密码页面。但是,现在我的问题是当用户单击电子邮件中的“重置密码链接”时,它会将他们链接到登录页面而不是重置密码页面。我对电子邮件验证做了同样的事情,它工作正常。这是示例链接 https://example.com/resetPassword?email=example@gmail.com&token=7998c53c6d3c5832afb092fd5a6e2a63fc0a5c15b4d593e36750cccd337be395
下面是我在场景委托中的代码。
func scene(_ scene: UIScene,continue userActivity: NSUserActivity) {
guard userActivity.activityType == NSUserActivityTypebrowsingWeb,let url = userActivity.webpageURL,let components = URLComponents(url: url,resolvingAgainstBaseURL: true)
else{
return
}
for queryItem in components.queryItems ?? [] {
if queryItem.name == "emailVerified" && queryItem.value == "false"{
print("email verified link")
navigatePush(destination: .appointmentMain)
}
else{
return
}
}
for queryItem in components.queryItems ?? [] {
if queryItem.name == "email" && queryItem.name == "token"{
print("reset password link")
navigatePush(destination: .resetPassword)
}
else{
return
}
}
}
知道为什么我无法导航回重置密码页面吗?提前谢谢你。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)