model-viewer icon indicating copy to clipboard operation
model-viewer copied to clipboard

Issue where website sharing link changes to usdz model link in quicklook in iOS 17.0.3 version.

Open jungwoolee-letsee opened this issue 1 year ago • 10 comments

Description

hello.

When you open quicklook through modelviewer in iOS 17.0.3 and click the share button, the correct link is not sent.

When sharing a link after moving to sceneviewer or quicklook through modelviewer, the URL where modelviewer operates must be shared, but strangely, when opening quicklook, there is a problem in which the asset uri of the model referenced through ios-src is transmitted.

It works correctly on Android's SceneViewer and other versions of iOS (<17). I have attached some photos of the related issue below. If you know the solution, please let me know. Thank you.

Live Demo

Code

import '@google/model-viewer/lib/model-viewer'
import { useLayoutEffect, useRef } from 'react'
import { ViewerStateType } from '@src/utils/types.ts'
import { useAppSelector } from '@src/redux/store.ts'
import hdri from '@static/media/images/photo_studio_01_1k.hdr?url'

export default function ViewerPage() {
  const viewerRef = useRef<HTMLDivElement>(null!)
  const arBtnRef = useRef<HTMLButtonElement>(null!)
  const { currentItem }: ViewerStateType = useAppSelector((state) => state.viewer)

  useLayoutEffect(() => {
    if (!currentItem) return
    viewerRef.current.setAttribute('src', currentItem.src)
    viewerRef.current.setAttribute('ios-src', currentItem.iosSrc)
  }, [currentItem])

  return (
    <div className='flex flex-col h-full w-full'>
      <model-viewer
        ref={viewerRef}
        id='model-viewer'
        ar
        ar-modes='scene-viewer quick-look'
        shadow-intensity='1'
        camera-controls
        environment-image={hdri}
        style={{ width: '100%', height: '100%' }}
      >
        <button slot='ar-button' id='ar-button' ref={arBtnRef} style={{ display: 'none' }}>
          View in your space
        </button>
      </model-viewer>
    </div>
  )
}

Version

  • model-viewer: v3.2.1

Browser Affected

  • [ ] Chrome, version: xx.x.xxxx.xx
  • [ ] Edge
  • [ ] Firefox
  • [ ] IE
  • [x] Safari

OS

  • [ ] Android
  • [x] iOS
  • [ ] Linux
  • [ ] MacOS
  • [ ] Windows

AR

  • [ ] WebXR
  • [ ] SceneViewer
  • [x] QuickLook

jungwoolee-letsee avatar Oct 26 '23 07:10 jungwoolee-letsee

Since it worked on previous versions of iOS, this sounds like a Quick Look regression. There's nothing I can do about that besides ask @grorg to fix it. I'd also recommend filing a bug on WebKit (quicklook bugs often get fixed there).

elalish avatar Oct 26 '23 17:10 elalish

Definitely an iOS ARQL regression.

Reported: https://bugs.webkit.org/show_bug.cgi?id=263878

Workaround:

  • This can be somewhat mitigated by using the canonicalWebPageURL USDZ parameter.
  • But note that there is an existing bug that limits the effectiveness of canonicalWebPageURL when originating HTML page has multiple query parameters (https://bugs.webkit.org/show_bug.cgi?id=248219)

milesgreen avatar Oct 30 '23 13:10 milesgreen

Hi there, @milesgreen:

As you've stated, some important issues just have appeared on iOS 17.X, directly related with the way the new bundled Safari version is managing the URL of USDZ/.Reality files. Same files are processed flawless in iOS16 and below.

As said in this other thread, hosting in my server a no-doubt-well-formed AR file, as is the "CosmonautSuit_en.reality" from Apple's examples (https://developer.apple.com/augmented-reality/quick-look/) is showing the annoying "Object requires a newer version of iOS." message, even when I'm running iOS 17.1 in my iPad. That is, the very last available version.

Please note that this warning message only appears when accessing the file from an HTML anchor tag, this way:

<a rel="ar" href="https://artest.myhost.com/CosmonautSuit_en.reality">
   <img class="image-model" src="https://artest.myhost.com/cosmonaut.png" alt="">
</a>

...but not when accessing directly the URL typing it in the Safari navigation editbox.

Best regards.

vortice3D avatar Oct 30 '23 19:10 vortice3D

Share URL regression is still an issue in iOS 17.2 Beta 3 (21C5046c)

milesgreen avatar Nov 16 '23 09:11 milesgreen

still an issue

gwendall avatar Dec 16 '23 00:12 gwendall

Default share link is still an issue in iOS 17.5 beta. Best bet is to start relying on canonicalWebPageURL at this point.

milesgreen avatar Apr 08 '24 13:04 milesgreen

@AdaRoseCannon - another lingering iOS ARQL issue for you...

This has been reported on WebKit Bugzilla here: https://bugs.webkit.org/show_bug.cgi?id=263878

Reported via Feedback Assistant (FB13608976)


When tapping the Share link (top right) from ARQL, prior to iOS17, this would share the originating HTML page URL by default.

Since iOS 17, this shares the URI directly to the USDZ itself.

Repro:

  • On iOS17 device, visit: https://developer.apple.com/augmented-reality/quick-look/
  • Tap on a thumbnail to view in AR
  • In ARQL, tap Share button
  • Copy link
  • Observe that it is the USDZ URI and not the originating page URL

This becomes even more noticeable when viewing a USDZ blob.

In this case the Share URL is the blob ID string.

This cannot be interpreted successfully by any app or person it is shared too.

Repro:

  • See this URL to test generating a USDZ blob: https://arquicklook-usdz-blob.glitch.me/
  • Tap to view in AR.
  • Tap the Share link.
  • Observe that the shared url is the blob string ID.

milesgreen avatar May 05 '24 13:05 milesgreen

Retesting. Still an issue in iOS 18.0 Dev Beta 5 (22A5326f)

milesgreen avatar Aug 07 '24 16:08 milesgreen