Pavel Sadchenko
Pavel Sadchenko

Reputation: 131

Avoid confirmation dialog for url scheme redirection in iOS9

To open a native app from Safari we are using a url scheme redirection like myapp://do/something.

I know at least two ways to achive this:

  1. Inserting iframe with src attribute equal to desired url (works on iOS8 only, stopped working on iOS9)
  2. Replacing window.location.href property with desired url (works for both iOS8 and iOS9)

The both ways work well for iOS8 and redirect a user immediately to the installed application without any confirmation dialog. But starting from iOS9 Safari began to show a confirmation dialog to make sure that a user really wants to open an app:

enter image description here

Code on the page from above screenshot is pretty simple:

<!DOCTYPE html>
<html>
<head></head>
<body>
    <script>
        window.location.href = 'fb://';
    </script>
</body>
</html>

I found no any official description for this changes on apple's site. It seems to me that there is nothing we can do with this behaviour.

QUESTION: Is somebody already faced this problem? Any ideas how we can avoid this confirmation box in Safari?

Upvotes: 3

Views: 2426

Answers (1)

Eric Johnson
Eric Johnson

Reputation: 41

The confirmation dialog was added to address known vulnerabilities in many apps with registered iOS URL Schemes. It prevents malicious web pages from invoking URL Schemes that cause apps to make transactions on the users behalf without their knowledge. I'm not aware of any way to disable it.

More details on the vulnerability can be found in this BSides Las Vegas presentation: http://www.irongeek.com/i.php?page=videos/bsideslasvegas2014/pg10-ios-url-schemes-omg-guillaume-k-ross

Upvotes: 4

Related Questions