How should I do feature detection for AR support? #1866
Replies: 9 comments
-
@milesgreen I would take a look at what we do for activating Scene Viewer: https://github.com/GoogleWebComponents/model-viewer/blob/2d4aaf35735397a1d89f7f5df28f8a0a080d569c/src/features/ar.ts#L38-L82 The important thing to understand is that there is no way to detect the availability of Scene Viewer up front. You have to trigger an intent, and you can only trigger an intent when the user interacts with the page. When the intent fails, it will navigate to a configured browser fallback URL if provided. In
|
Beta Was this translation helpful? Give feedback.
-
OK. Thanks. So we can't predetermine if it'll work on a user's device, but we can detect if the intent fails. Got it. With regards to listening for fullscreen; but doesn't Surfacing Scene Viewer intent failing as an event of |
Beta Was this translation helpful? Give feedback.
-
@milesgreen When you see the Yes I would also find it useful to have an event triggered for intent failing. |
Beta Was this translation helpful? Give feedback.
-
Thanks for clarifying @mkeblx |
Beta Was this translation helpful? Give feedback.
-
@cdata Hi there,
Questions:
Thank you so much |
Beta Was this translation helpful? Give feedback.
-
Yes, that's possible with Android devices. Unfortunately, If you combine the documentation above with the documentation for launching Scene Viewer, you can achieve what you are trying to do: https://developers.google.com/ar/develop/java/scene-viewer Separately, it would be feasible for us to dispatch an even when we fail to launch Scene Viewer. However, we do not do that today, so it would need to be a separate feature request. |
Beta Was this translation helpful? Give feedback.
-
@cdata is there any update on this with latest releases? the feature detection and event triggering about Scene Viewer launch fail is the same of the previous comments? Thanks |
Beta Was this translation helpful? Give feedback.
-
@nicolocarpignoli Things have improved a bit in this regard. We now expose an |
Beta Was this translation helpful? Give feedback.
-
That's good to know, thanks! About iOS: last time I tried it was available for iOS 13 - and now 14 (it was NOT working for iOS 12 even if they claim it does). I don't know if now they fixed it on iOS 12 but the more we go on the less is relevant. Probably now iOS 13 + iOS 14 covers pretty much the 80-85% of Apple's devices |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What’s the best way to do feature detection to check for AR support on a device?
Would like to display alternative content / messaging. Not sure best way to tell if SceneViewer is supported and available?
Beta Was this translation helpful? Give feedback.
All reactions