移动浏览器:如何在原始选项卡中打开重定向链接?

发布于 2025-01-27 04:44:32 字数 550 浏览 4 评论 0原文

我要做的是在移动 - 萨法里 / iOS中要做的是:

  1. 在我的Web应用中,将深链链路打开到安装在用户手机上的应用程序中,
  2. 用户在此应用中签署了一条消息,应用程序将
  3. 应用程序重定向到我的redirect_url ,回到我的Web应用程序,
  4. 我的Web应用程序解析了该应用程序添加到redirect_url的查询 - 帕拉姆斯

这是我的Web应用程序如何在用户的移动浏览器上与本机移动应用通信的基本流程。我想知道;有没有办法设置redirect_url使重定向回到打开的原始标签?这将是一个翻页,这意味着任何内存数据都会丢失,但是我可以生存下来。每次循环时,iOS都会打开我的Web应用程序的多个选项卡,这很奇怪,而且我什至无法保证iOS会打开同一Web-Browser(如果Safari如果Safari,它可能会从Chrome到Safari。例如,默认值)。

理想情况下,我想每次使用相同的Web浏览器,相同的选项卡。我正在使用window.location.replace(ConnectUrl)进行重定向。

该通信流有任何解决方案 /建议吗?谢谢。

What I'm trying to do, in mobile-safari / iOS is:

  1. in my web-app, open a deep-link into an app installed on the user's phone
  2. the user signs a message in this app
  3. the app redirects back to my redirect_url, coming back to my web-app
  4. my web-app parses the query-params added to the redirect_url by the app

This is a basic flow of how my web-app can communicate with a native mobile-app on a user's mobile-browser. I'm wondering though; is there a way to set the redirect_url such that the redirect comes BACK to the original tab that was open? It will be a page-refresh, meaning any in-memory data will be lost, but I can survive that. It's just weird that iOS will open up multiple tabs of my web-app every time we do a loop, and also I can't even guarantee that iOS will open up the same web-browser (it might go from Chrome to Safari if Safari is default, for example).

Ideally, I'd like to use the same web-browser, same tab every time. I'm using window.location.replace(connectURL) to do the redirect by the way.

Any solutions / suggestions for this communication flow? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文