google / model-viewer

Easily display interactive 3D models on the web and in AR!
https://modelviewer.dev
Apache License 2.0
6.93k stars 818 forks source link

Title and Link attributes break link to launch model viewer #4431

Closed mfebrey closed 1 year ago

mfebrey commented 1 year ago

Description

I have a web page link that launches scene viewer on Android mobile devices. It currently works without the Link and Title attributes. Once I add the Link and Title attributes the link stops working... becomes unclickable. I'm trying to add a "buy tickets" link with title at the bottom of the scene veiwer.

CODE THAT IS WORKING: <a id="androidLink" href="intent://arvr.google.com/scene-viewer/1.0?file=https://www.oceanandcake.com/wp-content/uploads/COF31.glb&amp;mode=ar_only#Intent;scheme=https;package=com.google.ar.core;action=android.intent.action.VIEW;S.browser_fallback_url=https://www.oceanandcake.com/color-of-fashion-xr-error/;end;">

CODE THAT IS NOT WORKING: <a id="androidLink" href="intent://arvr.google.com/scene-viewer/1.0?file=https://www.oceanandcake.com/wp-content/uploads/COF31.glb&amp;mode=ar_only#Intent;scheme=https;package=com.google.ar.core;action=android.intent.action.VIEW;S.browser_fallback_url=https://www.oceanandcake.com/color-of-fashion-xr-error/;title=Color%20of%20Fashion%20-%20Tickets%20+%20Details;link=https://www.oceanandcake.com/color-of-fashion/;end;">

*I've tried swapping the v to 1.1 as well. ie "/scene-viewer/1.1?file"

Live Demo

BOTH CHUNKS OF CODE FROM ABOVE ARE LIVE AND MARKED ON THIS PAGE https://www.oceanandcake.com/android-test/

Version

Browser Affected

Chrome version: not sure, I don't have an android device.

OS

Android

AR

SceneViewer

elalish commented 1 year ago

@eugenecys @AdrianAtGoogle Do you see any syntax problem with intent above? @mfebrey You said the OS is Android, but you don't have an Android phone - how are you testing this?

mfebrey commented 1 year ago

@eugenecys @AdrianAtGoogle Thanks for the reply. My client has an Android and have been testing with them. I need to get an Android for this, I know. Brand new to the G side of mobile XR dev. I don't see a syntax error. Would be most appreciative if you see something and can share.

samaneh-kazemi commented 1 year ago

@mfebrey I think it could be because you're missing the link before _browser_fallbackurl. I just tried this link and it worked on my end. (Pixel 7)

<a href="intent://arvr.google.com/scene-viewer/1.2?file=https://cdn.glitch.global/6c5aca2b-3427-4770-aa49-072a8e63bb2a/COF31.glb?v=1692639141263&title=Color%20of%20Fashion%20-%20Tickets%20+%20Details&mode=ar_only&link=https://www.oceanandcake.com/color-of-fashion#Intent;package=com.google.android.googlequicksearchbox;scheme=https;S.browser_fallback_url=https://arvr.google.com/scene-viewer/web?file=https://cdn.glitch.global/6c5aca2b-3427-4770-aa49-072a8e63bb2a/COF31.glb?v=1692639141263&title=Elroy+Accent+Chair+with+Wood+Legs+Natural+Linen&fdl=1&link=https://www.oceanandcake.com/color-of-fashion-xr-error;end;">

Demo link: https://tar-receptive-gopher.glitch.me

Glitch code: https://glitch.com/edit/#!/tar-receptive-gopher

mfebrey commented 1 year ago

Thank you, @samaneh-kazemi! That code did the trick, there was a repeated title attribute after the fallback that I deleted and it working like a gem. In my research no where did it state the title and link vars needed to be placed before the fallback. Thanks a lot. Here is the final link that works:

<a id="androidLink" href="intent://arvr.google.com/scene-viewer/1.2?file=https://cdn.glitch.global/6c5aca2b-3427-4770-aa49-072a8e63bb2a/COF31.glb?v=1692639141263&title=Color%20of%20Fashion%20-%20Tickets%20+%20Details&mode=ar_only&link=https://www.oceanandcake.com/color-of-fashion#Intent;package=com.google.android.googlequicksearchbox;scheme=https;S.browser_fallback_url=https://www.oceanandcake.com/color-of-fashion-xr-error;end;">