用户取消后,iOS Safari无法识别网址方案 [英] iOS Safari does not recognize url schemes after user cancels

查看:107
本文介绍了用户取消后,iOS Safari无法识别网址方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近注意到Safari中的奇怪行为.

I'm noticing strange behavior in Safari recently.

我为我的应用程序注册了一个网址方案,然后在Safari中输入myapp://. 这会立即启动我的应用.

I register a url scheme for the my app, and enter myapp:// into Safari. This launches my app immediately.

然后我返回Safari,然后再次将myapp://输入Safari, 这次它提示我要在"myapp"中打开此页面吗?" 取消或打开.

Then I go back to Safari, and enter myapp:// into Safari again, this time it prompts me "Open this page in "myapp"?" Cancel or Open.

如果我点击打开,我的应用将启动,随后的尝试将显示相同的警报.如果我尝试点击取消",则我的应用程序将无法启动.这是预期的.

My app will launch if I tap on open, and subsequent attempts the same alert shows. If I try tapping on cancel, my app will not launch. which is expected.

但是,如果我再次在URL栏中输入myapp://,则会提示我无法打开页面""Safari无法打开页面,因为地址无效."

However, if I enter myapp:// into the URL bar again, I'm prompted "Cannot Open Page" "Safari cannot open the page because the address is invalid."

在以后的所有尝试中,此操作都将以相同的方式失败,直到我杀死Safari并重新启动它,或打开另一个选项卡.

This will fail in the same way for all subsequent attempts, until I kill Safari and re-start it, or open another tab.

这与Youtube和Evernote的行为相同.我的猜测是,当用户点击取消"时,Safari将URL缓存为无效URL.是否有有关此行为的官方文档?

This is the same behavior with Youtube and Evernote. my guess is that Safari cached the URL as an invalid URL when the User taps on cancel. Is there official documentation on this behavior?

iOS 8.1.2和iOS 6.1.3中提供的

Bbserved in iOS 8.1.2 and iOS 6.1.3

推荐答案

在9.1中,该问题仍然存在.对我来说,解决方案是重新启动safari(向上滑动以将其从后台清除).

In 9.1 the issue still exists. The solution for me is just restarting safari (swipe up to clear it from background).

这篇关于用户取消后,iOS Safari无法识别网址方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆