Custom Action on AR Quick Look didn't work

Hello, I'm trying to use the Custom Action on a Custom banner of the AR Quick View.

I have a custom banner with my own html already loaded in the AR Quick View with this button:

<a href="https://www.google.com" target="_blank" id="ar-link">Check Now</a>

So I'm trying to capture the event with this:

const linkElement = document.getElementById("ar-link");
linkElement.addEventListener("message", function(event) {
    if (event.data == "_apple_ar_quicklook_button_tapped") {
        window.location.href = "https://www.google.com"
}, false);

But when I tap on the custom banner, i get the previous page so it seems not working. Do you know how to fix this? How is supposed to work and if this is available on the AR quick view from iOS browser or have some limitations?

Thanks in advance, is really weird to not been able to find more examples about this.

Answered by eyeclipse in 731358022

After a deep search across internet, I found it is a bug featured in webkit.

With the latest iOS version, 16, we have a workaround to solve it. You can check here: https://bugs.webkit.org/show_bug.cgi?id=245959

Already applied and working :) Thank you Eric!

My understanding of AR Quick look is that it’s pretty locked down and limited in functionality. I this found in the docs: “AR Quick Look displays the contents of the HTML only. If you embed actions such as links or events, AR Quick Look ignores them.”

https://developer.apple.com/documentation/arkit/adding_an_apple_pay_button_or_a_custom_action_in_ar_quick_look

Accepted Answer

After a deep search across internet, I found it is a bug featured in webkit.

With the latest iOS version, 16, we have a workaround to solve it. You can check here: https://bugs.webkit.org/show_bug.cgi?id=245959

Already applied and working :) Thank you Eric!

Custom Action on AR Quick Look didn't work
 
 
Q