0

First, we have an app and our domain supports Universal links on iOS9 and iOS10. On the landing page there is an element with 'href' attribute set to our domain. Clicking on it launches our native app or opens UL in the browser. This is working.

However when the same landing page is put inside an iframe(expected use case) that button doesn't work as expected. Instead of launching our app I can see in the Consoles: "https://domain/path/page.html" was not allowed to display insecure content from itms-appss://itunes.apple.com/app/appname/id#######?mt=8. Which means that UL mechanism didn't work and the browser actually retrieved the URL (which in turn is a simple PHP file sending the Location header redirecting to iTunes)

I thought may be there was something with our app or the page or the subdomain so I tried to add similar links for Instagram app. That didn't help because behavior was the same: UL mechanism didn't work and browser retrieved contents of the UL.

Pseudo-HTML:

<body>
<a href="universal_link">Works</a>

<iframe src="your_random_local_page.html">
    <a href="universal_link">Doesn't work</a>
</iframe>

</body>
Denis
  • 11
  • 1
  • 3

2 Answers2

2

Just leave from iframe by

<body>
<a href="universal_link">Works</a>

<iframe src="your_random_local_page.html">
      <a target="_top" href="universal_link">Doesn't work</a>
</iframe>

</body>

It's work fine for me.

Udom
  • 329
  • 2
  • 4
  • 18
  • Didn't expect this to work, but it actually does. Thank you. – Tarik Fojnica Jun 29 '18 at 15:07
  • @Rith Udom please provide working example, as your solution would be a game changer if it works on android(chrome) and ios(safari) to open app in mobile using customised universal link – Prasad Shinde May 30 '22 at 13:46
0

We need additional detail — there isn't enough here to get the full picture. Ideally, a link to your live landing page would be best, but failing that, at least more info on where the Universal Link is pointing.

Preliminarily, I suspect your Universal Link is somehow redirecting to the App Store page, which will be attempting to launch the App Store app itself via the itms-appss:// URI scheme. Custom URI scheme redirects within iFrames have been blocked since iOS 9.3, so this is would be expected behavior.

Alex Bauer
  • 13,147
  • 1
  • 27
  • 44
  • Alex, thanks for your interest. Let me try to clarify this more without too much details. Universal Link basically is pointing to PHP file which is registered in apple-app-site-association file. So if this link is clicked from the top window or from the Notes app then our native app is launched. Php file just returns Location header redirecting to iTunes so user can install the app. Seems like UL mechanism is not working in the iframe if we get logs about iTunes – Denis Nov 30 '16 at 19:09
  • That doesn't surprise me. Users would find it quite startling if an iframe were able to unexpectedly trigger a different app. Apple has been quite conservative about Universal Links requiring some sort of user action, so this sounds like a likely limitation. – Alex Bauer Dec 01 '16 at 04:04