Search code examples
iossafariaugmented-realityquicklook

Open USDZ File into QuickLook


I am interested in opening a USDZ file in a Safari browser and making sure that it ends up in the QLPreviewer and I was wondering if there is a browser API for safari that can do this. I want to make sure that the link doesn't just open in a new tab.

I have tried just opening a USDZ file but that just gives the appearance of a new tab where you have the option to open into files and stuff like that.

There isn't really any code yet but if that is the best way to achieve this that would make sense.

I see so from what I have read here you need to specify the rel="ar" which I am still not sure if it is working. I have tried it within codepen and nothing is really happening.

<a rel="ar" href="https://s3.amazonaws.com/test.cylindev.com/AR/4472/YF2013-XH-F-1S/JLA-8852-29.usdz">
    <img src=""><div class="ar-glyph-background">
    <div class="ar-icon"></div>
    <div class="ar-text">View in AR</div></div>
</a>

It still doesn't work in a codepen environment but I know you can access previews from that environment and I am not sure where the issue is.


Solution

  • It turns out that you need an image tag within the link and the code I was actually using didn't have that image tag. Very weird choice by the apple devs.