MetaMask / metamask-mobile

Mobile web browser providing access to websites that use the Ethereum blockchain
https://metamask.io
Other
2.14k stars 1.1k forks source link

Support for WebXR in browser #3531

Open nwilging opened 2 years ago

nwilging commented 2 years ago

Describe the usability problem

WebXR is not supported within the metamask browser. This is not necessarily a bug, but rather a potential enhancement.

Expected behavior

WebXR is a 3D rendering API supporting AR/VR in the browser. This is an especially intuitive feature on mobile devices, whose modern models have robust AR/VR support.

The potential use case is for a web3 connected application to be able to render 3D models in AR. Due to the web3 dependency, using the application within a Dapp browser such as metamask is a requirement.

The easiest method of implementing WebXR AR rendering is with Google's model-viewer module. Implementing this module in an application accessed by the metamask browser will show that the 3D model can be rendered on the page (using webGL), but the associated AR functionality for the viewer does not work in the metamask browser.

The expected functionality can be seen by running the same application in a regular chrome mobile browser (on Android preferably, as iOS also has some issues with WebXR - though model-viewer does support iOS AR as well): the 3D model can be rendered in AR on the mobile device.

In fact, this example from Google's model-viewer docs is a great illustration of the functionality. Using that example in chrome on Android yields the expected result, and in metamask does not.


I plan on debugging this functionality, as the model-viewer does detect AR capabilities but is unable to launch WebXR. I've just recent found this repository, so I plan on building and debugging the app at some point in the near future. I figured I'd get this issue in and update it along the way, and see if anyone else may be interested in the same functionality.


filled out after submission

User impact | Usage frequency | Feasibility scores How important is this to the user, what the user wants to accomplish | Daily, weekly, monthly | Small, medium, large

sprengerst commented 2 years ago

+1

nikhildigde commented 1 year ago

+1 @nwilging did you manage to get something around this? any good workarounds like using walletconnect + metamask? But the user experience wont be gr8

nwilging commented 1 year ago

+1 @nwilging did you manage to get something around this? any good workarounds like using walletconnect + metamask? But the user experience wont be gr8

unfortunately i have not found a workaround or solution. The root of the issue is that Android WebViews do not support WebXR. See:

I primarily work on Android, but I imagine the iOS component for web views behaves in a similar way. At the time when I opened this issue I had a partner testing things on iOS and reporting the same behavior.