iPhone 应用程序中的 URL 方案

发布于 2024-10-10 06:30:53 字数 146 浏览 0 评论 0原文

我有一个 iPhone 应用程序,我想向其中添加 URL 方案。问题是我有免费版和增强版。

我想做的是对两个应用程序使用相同的方案,但如果安装了 plus 版本,我希望启动 PLUS 版本而不是免费版本。 这可能吗?

兄弟,
保罗·皮伦

I have an iPhone application which I wanted to add URL schemes to. The thing is that I have both a free version and a plus version.

What I would like to do is use the same scheme for both apps, but if the plus version is installed I want to the PLUS version to launch instead of the free version.
Is that possible?

Br,
Paul Peelen

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一个人练习一个人 2024-10-17 06:30:53

不会。如果多个应用程序注册相同的 URL 方案,则操作系统将激活哪个应用程序是不确定的。来自 iOS 应用程序编程指南:

注意:如果多个第三方应用程序注册来处理相同的 URL 方案,则未定义选择哪个应用程序来处理该类型的 URL。

编辑:只是想一下如何解决此问题:让您的增强版注册您不发布的第二个私有 URL 方案。然后,如果您的免费应用程序是从 URL 启动的,请让它检查 plus 版本是否存在并将传递的 URL 转发到 plus 版本(通过其私有 URL 方案)。

No. If multiple apps register for the same URL scheme, it is undefined which app will be activated by the OS. From the iOS Application Programming Guide:

Note: If multiple third-party applications register to handle the same URL scheme, it is undefined as to which of the applications is picked to handle URLs of that type.

Edit: just a thought how you might work around this issue: have your plus version register a second private URL scheme that you do not publish. Then, if your free app is launched from a URL, have it check whether the plus version is present and forward the passed URL to the plus version (via its private URL scheme).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文