Skip to content

Latest commit

 

History

History
75 lines (50 loc) · 3.88 KB

CODE-TRACK.md

File metadata and controls

75 lines (50 loc) · 3.88 KB

Code track: ViroReact + Expo

You'll build with ViroReact (@reactvision/react-viro) inside an Expo app, starting from the official starter kit.

What you need

  • A laptop with Node.js 22.13 or newer (the Expo SDK 57 minimum), Yarn (npm install -g yarn) and Git
  • A real phone that supports AR: an iPhone (ARKit) or an Android phone with ARCore. AR doesn't work in simulators.
  • For iOS: a Mac with Xcode 26.4 or newer, signed in with your Apple ID (Xcode → Settings → Accounts), and Developer Mode turned on on the iPhone (Settings → Privacy & Security → Developer Mode). For Android: Android Studio and USB debugging turned on.
  • Optional: a Meta Quest (see QUEST.md)

⚠️ ViroReact does not run in Expo Go. You need a development build (npx expo run:ios / npx expo run:android, or npx expo prebuild). If you open the project in Expo Go, it will fail.

1. Get the starter kit

Clone the official kit and start a new git history:

git clone --depth 1 https://github.com/ReactVision/expo-starter-kit-typescript.git my-ctrl-space-app
cd my-ctrl-space-app
rm -rf .git && git init   # new history that starts during build week

It's TypeScript with Expo Router and includes demo scenes you can copy from: auto plane detection, manual plane placement, no-plane placement, physics (bowling), shaders and a geospatial anchor.

Push this to a new public GitHub repo of your own (git remote add origin <your-repo-url>). Your commit history should start during build week; the kit is a starter, so list it in your tech stack.

2. Install and build

yarn install
npx expo prebuild --clean   # generates the native ios/ and android/ folders
npx expo run:ios            # or: npx expo run:android

Before your first build, open app.json and change ios.bundleIdentifier and android.package to your own ids (for example com.yourname.ctrlspace). Everyone who clones the kit starts with the same ids, and Apple lets only one developer team register each one, so Xcode can refuse to sign the default.

Plug your phone in first. To pick a specific iOS device: npx expo run:ios -d "<device name>".

After the first native build, you can start the dev server on its own:

npx expo start --dev-client

Something off? Run npx expo-doctor.

3. Make it yours

  • Open one of the demo scenes, copy it, and swap in your own 3D models and interactions.
  • The geospatial anchor demo needs a ReactVision API key and project ID in app.json (rvApiKey and rvProjectId; create both in Studio, see the setup guide). A Google Cloud key is only needed if you switch to Google's ARCore provider. The other demos work without any setup.
  • Let your AI agent help: connect the ViroReact MCP server (MCP.md) so it can run and check your scenes.

Adding ViroReact to your own Expo app instead

If you'd rather start from a blank Expo app:

  1. npx create-expo-app@latest my-app --template blank-typescript@sdk-57
  2. cd my-app, then npm install @reactvision/react-viro and npx expo install expo-build-properties
  3. Add both plugins to the plugins array in app.json. enableSceneSupport is required when you build with Xcode 27 (iOS 27); without it the app closes at launch. xRMode makes the Android build AR-only.
    "plugins": [
      ["expo-build-properties", { "ios": { "enableSceneSupport": true } }],
      ["@reactvision/react-viro", { "android": { "xRMode": ["AR"] } }]
    ]
  4. npx expo prebuild --clean, then npx expo run:ios or npx expo run:android.

The plugin adds the iOS camera, microphone and photo-library permission strings for you.

Full guide: https://viro-community.readme.io/docs/integrating-with-expo

Stuck?

Post in #submission-help with your OS, device, Expo SDK version and the error message. Screenshots of the full error help a lot.