Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Safari cannot open the page because the address is invalid" message appears when I try to launch my app from a website

Device : iPhone 5 / iOS 9.3

I have an iOS app which I need to launch from a website. I was able to do it via custom URL scheme.

When I click the "Open App" button in the website, an alert dialog appears that says "Safari wants to open MyApp" with OK & Cancel buttons.

Clicking OK : everything is just fine. The app gets launched from the website perfectly.

Clicking Cancel : First time, it just dismisses preventing the app being launched, which is correct.

When I click on the "Open App" button once again from the website, I expect the same "Safari wants to launch MyApp" alert dialog to appear once again, which is not happening.

Instead, it shows a dialog that says "Cannot Open Page - Safari cannot open the page because the address is invalid" with an OK button.

My assumption was, every time when you click on that link in the website (that can launch the app via custom url scheme), I should be prompted with "safari wants to open MyApp" alert dialog all the time.

What am I missing here ? Appreciate your help in advance.

like image 977
Vignesh Kumar Avatar asked Sep 19 '16 04:09

Vignesh Kumar


People also ask

Why does Safari keep telling me the address is invalid?

Invalid URI schemes: If the link doesn't have a valid URI scheme that you're using to redirect you will get this error message. You can clear your Safari cache (Settings > Safari > Clear History and Website Data) to remove the error.

Why does my iPhone say Safari Cannot open the page because the address is invalid?

If the DNS server that you use on your device is facing a downtime, you can get errors like iPhone Safari cannot open page because the address is invalid. In that case, your best solution is to change your DNS servers to something that works.

Why is Safari not letting me open a page?

Check Safari settingsThe webpage might not be compatible with one or more browser settings, which you can turn on or off as needed. From the menu bar in Safari, choose Safari > Settings (or Preferences). Then click Websites, Privacy, or Security to access these settings: Websites settings.


1 Answers

It's a known behavior.

If you tap on facebook://feeds:

And open it then Safari won't blacklist the facebook scheme for that Safari tab. You would be allowed to open facebook://profile, facebook://feeds, facebook://settings, etc. on that tab

However if you click on 'Cancel' then you're no longer able to able any url with that scheme for that tab only ie you won't be able to open facebook://profile, because it's been blacklisted for that tab.

What should you do?

Open a new tab and try again. It would no longer be blacklisted for that tab.

It would have been much better though if Apple prompted its user with options like:

Deny once. Deny Always. Allow Always

But I'm guessing if they did that then they'd have to provide alternate ways for the user to customize behavior per host/scheme. Obviously Apple doesn't want to allow that.

like image 97
mfaani Avatar answered Oct 13 '22 18:10

mfaani