iPhone 应用程序中的 URL 方案
我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不会。如果多个应用程序注册相同的 URL 方案,则操作系统将激活哪个应用程序是不确定的。来自 iOS 应用程序编程指南:
编辑:只是想一下如何解决此问题:让您的增强版注册您不发布的第二个私有 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:
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).