webXR shows "AR session supported" on unsupported device
See original GitHub issueDescribe the bug
This phone does not have ar-core support , but the start ar buttons is present
& navigator.xr.isSessionSupported('immersive-ar')
returns true
but clicking on the button asks camera permissions then crashes (screenshot has error message)
Expected behavior
This device does not support google ar core , so navigator.xr.isSessionSupported('immersive-ar')
should return false as
AR experiences on Android can only be run on an ARCore supported device.
Screenshots
Platform:
- Device: [Mobile: Samsung galaxy M30]
- OS: [Android]
- Browser: [Chrome]
- Three.js version: [r135]
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Starting up and shutting down a WebXR session - Web APIs
This object represents the overall WebXR device suite available to ... It introduced support for augmented reality (AR) through the WebXR AR ......
Read more >immersive-ar samples not working · Issue #61 - GitHub
Attached debugger shows XRSession creation failed: The specified session configuration is not supported. Hi Mate! Same problem here! Dis you ...
Read more >WebXR requirements | ARCore - Google Developers
AR experiences on Android can only be run on an ARCore supported device. Ensure that the device has Google Play Services for AR...
Read more >WebXR Device API Explained - Immersive Web
The WebXR Device API provides access to input and output capabilities commonly associated with Virtual Reality (VR) and Augmented Reality (AR) devices.
Read more >WebXR Device API - W3C
A session mode of immersive-vr indicates that the session's output will be given exclusive access to the immersive XR device display and that ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Summary
This error comes from WebXR API, not three.js (I think) .
details
Based on my experience, When the test machine meets the following 2 conditions,
navigator.xr.isSessionSupported('immersive-ar')
will always returntrue
(fulfilled) : ① phone ② https Otherwise it will return false.When I use a mobile phone (not supporting ARcore) to visit a WebXR site that uses https, the following events will occur in sequence: ①
navigator.xr.isSessionSupported('immersive-ar')
will returntrue
(fulfilled) ② A pop-up box in the middle of Chrome asks me “whether to grant AR permissions to the site” (If the user has granted this permission to the site, this step will not appear) ③ I allow to grant AR permissions to this site ④ The pop-up box at the bottom of Chrome says “ARCORE needs to be installed” ⑤ I click “install” ⑥ After a short loading animation, the phone jumps to the ARCORE download page of the App store (Some phones may not automatically redirect to the App store, this is most likely because ARCore is not listed on the App Store of this phone, at this time, you can only download ARcore on Google Play by yourself) ⑦ Install ARCore ⑧ The App Store pop-up prompts “The app is not adapted to your device, and abnormal conditions such as freezes and flashbacks may occur during operation. It is recommended to wait for the app developer to solve the adaptation problem before trying to install.” (This is why you see “crashes”) ⑨ Restart the site and start the AR program (immersive-ar) ⑩ crashesObviously, this bug (
navigator.xr.isSessionSupported('immersive-ar')
will always returntrue
on phone that do not support ARCore) comes from the WebXR API. It should not be fixed by modifying three.js, the bug has nothing to do with the device (I think) .Code
Most of the code related to “three.js” is omitted
Other
I have a device that supports ARCore, which can run the WebXR application built by the above code normally
Closing then. I’m not sure where it’s best to report this issue but the browser vendor might be a good start.