tzl tzl - 1 year ago 114
iOS Question

iOS Safari does not recognize url schemes after user cancels

I'm noticing strange behavior in Safari recently.

I register a url scheme for the my app, and enter

into Safari.
This launches my app immediately.

Then I go back to Safari, and enter
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.

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

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

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?

Bbserved in iOS 8.1.2 and iOS 6.1.3

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download