Uh oh!
There was an error while loading. Please reload this page.
feat: implement XR API - #81
Conversation
matthargett
commented
Jan 25, 2024
Try to cross-reference the WebXR/OpenXR API to see if we can find a middle ground between them and visionOS specifics. It would be nice to be able to use this API across XR devices. |
okwasniewski
commented
Jan 26, 2024
@matthargett Looks like equivalent for WebXR is
WebXR returns |
b86a6ed to
77f00b4CompareThere was a problem hiding this comment.
I needed to generate separate set of Codegen specs for visionOS because the built-in one was overwritten when I used Yarn 4 (with Yarn v1 it was working fine) I'm guessing the issue comes from the order of how node_modules are discoevered by codegen.
If codegen finds react-native-visionos first, then react-native generated spec overwrites it later, but if it finds it second then everything is working fine.
cc: @Saadnajmi - you mentioned that rn-macos overwrites some Codegen specs of Alert module - maybe you will also run into this or maybe it's only related to adding new modules
There was a problem hiding this comment.
is there a way to fix this in yarn or RN codegen so it resolved in a human-observable order, rather than inode creation order(UNIX-based) or something else random on Windows? This is a class of support issue that can devolve into "works fine on my machine" :/
There was a problem hiding this comment.
Are you using yarn 4 with the node_modules linker? curious
There was a problem hiding this comment.
Yes! With node_modules linker, I'm not sure why there is a discrepancy between those versions but it kind of makes sense as @callstack/react-native-visionos is higher in the node_modules folder than react-native (therefore the overwrite). I think creating a separate spec for OOT platform-specific modules is a safer bet
There was a problem hiding this comment.
Todo: check how this affects rest of the app
There was a problem hiding this comment.
on RNM, turning this on meant going through a different code path for intializing the window / scene, so the window set by RCTAppDelegate stopped showing. I guess on this fork, y'all have already gone full custom SwiftUI entry point though.
4e296d7 to
f241740Compare149ed11 to
c572facComparec572fac to
5e78af5Compare5e78af5 to
d44ac88Compare
Summary:
This PR introduces the
XRAPI.Example:
To-Do
Opening immersive space might fail in two scenarios: 1. App doesn't support multi window, user cancels the operation.
Demo
CleanShot.2024-01-26.at.11.01.58.mp4