androidandroid-intentandroid-augmented-realityweb-ar

How to launch web AR on android from a QR code


Given a GLTF (or GLB) asset, one can launch the WebAR experience on an android phone via a url like: intent://arvr.google.com/scene-viewer/1.0?file=<insertURLHere>&title=MyWebArAsset&disable_occlusion=true&mode=ar_preferred#Intent;scheme=https;package=com.google.android.googlequicksearchbox;action=android.intent.action.VIEW;end; (https://developers.google.com/ar/develop/scene-viewer) However, if you put that same intent URL into a QR code and scan it, instead of opening in the Web AR viewer, it takes me to a google search. If i remove the intent, and just put the file-path into the QR code, it just downloads the file. Is there any way to trigger web AR viewer on android directly from a QR code?


Solution

  • QR Code readers may not interpret the WebAR URI correctly due to the 'Intent' format.

    One workaround is to include the WebAR URI as a redirect from a site or a link shortener so that Chrome is handling the intent construction.

    The additional 'wrapping of the WebAR URI' may allow for alternate behaviors for non-Android devices or truthful non-supporting browsers via User Agent checking.