leoncvlt/ar-button

quick-look-button-tapped

Closed this issue · 3 comments

Hey, thanks for this code. However the eventlistener doesn't work on your example or when trying on my end.
Any suggestions?

YOUR CODE:

  <script>
    const arButton = document.querySelector("ar-button");
    arButton.addEventListener("quick-look-button-tapped", () => {
      window.location.href = "https://https://www.nasa.gov/";
    });
  </script>

APPLE DEV CODE which works using a regular A link, but just not using your ar-button

<script>
document.getDocumentbyID("ar-link-2").addEventListener("message", function (event) {   
    if (event.data == "_apple_ar_quicklook_button_tapped") {
        window.location.assign("https://google.com");
    }
}, false);
</script>

Any assistance would be great. Thanks!

Should be fixed with #3 , can you confirm?

Hey, thanks so much for taking a look at this.
I just checked on your site and reloaded the js
now the button doesn't send you into AR so I can't confirm if that fixed the link at this point.

changing this line back to add the window.MSSTREAM makes the button clickable again, but the change from button to listener did not resolve the link

(/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) ||

@mtdmali 's pull request has been published on npm as version 0.3.0 - @eemaano does it fixed the issue?