{"id":22691065,"url":"https://github.com/said-aabilla/augmented-reality-react-native","last_synced_at":"2026-02-16T17:02:28.131Z","repository":{"id":263624800,"uuid":"812761023","full_name":"Said-Aabilla/augmented-reality-react-native","owner":"Said-Aabilla","description":"Augmented Reality Application using react native and Viro (based on ARCore)","archived":false,"fork":false,"pushed_at":"2024-11-19T14:23:59.000Z","size":4656,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T22:54:24.156Z","etag":null,"topics":["3d-models","android","augmented-reality","ios","react-native"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Said-Aabilla.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-09T19:58:30.000Z","updated_at":"2024-11-27T22:22:21.000Z","dependencies_parsed_at":"2024-11-19T15:43:49.134Z","dependency_job_id":null,"html_url":"https://github.com/Said-Aabilla/augmented-reality-react-native","commit_stats":null,"previous_names":["said-aabilla/ar_react_native"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Said-Aabilla/augmented-reality-react-native","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Said-Aabilla%2Faugmented-reality-react-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Said-Aabilla%2Faugmented-reality-react-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Said-Aabilla%2Faugmented-reality-react-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Said-Aabilla%2Faugmented-reality-react-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Said-Aabilla","download_url":"https://codeload.github.com/Said-Aabilla/augmented-reality-react-native/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Said-Aabilla%2Faugmented-reality-react-native/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29513434,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d-models","android","augmented-reality","ios","react-native"],"created_at":"2024-12-10T01:09:19.813Z","updated_at":"2026-02-16T17:02:28.117Z","avatar_url":"https://github.com/Said-Aabilla.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Native AR Integration Tutorial with @reactvision/react-viro\n\nThis guide provides step-by-step instructions to integrate AR functionality into a React Native project using the `@reactvision/react-viro` library.\n\n---\n\n## Steps\n\n### Step 1: Install the Library\nRun the following command to install `@reactvision/react-viro`:\n```bash\nnpm install --save @reactvision/react-viro\n```\n\n### Step 2: Update `app.json`\nAdd the following configuration to the `plugins` array in your `app.json` file:\n\n```json\n[\n  \"@reactvision/react-viro\",\n  {\n    \"android\": {\n      \"xRMode\": [\"AR\"]\n    },\n    \"ios\": {\n      \"cameraUsagePermission\": \"$(PRODUCT_NAME) uses your camera for AR experiences. This is a custom InfoPlist string!\",\n      \"microphoneUsagePermission\": \"$(PRODUCT_NAME) uses your microphone for AR experiences. This is a custom InfoPlist string!\",\n      \"photosPermission\": \"$(PRODUCT_NAME) would like to read photos for AR experiences. This is a custom InfoPlist string!\",\n      \"savephotosPermission\": \"$(PRODUCT_NAME) would like to save photos to your library during AR experiences. This is a custom InfoPlist string!\"\n    }\n  }\n]\n```\n\n### Step 3: Generate Android Folder\nRun the following command to generate the `android` folder:\n\n```bash\nnpx expo prebuild --clean -p android --no-install\n```\n\n### Step 4: Create and Modify `metro.config.js`\nCreate the `metro.config.js` file using the following command:\n\n```bash\nnpx expo customize metro.config.js\n```\n\nModify the file to include the following configuration:\n\n```javascript\nCopier le code\nconst { getDefaultConfig } = require('expo/metro-config');\n\nconst config = getDefaultConfig(__dirname);\n\nconfig.resolver.assetExts.push(\n  // Adds support for `glb` files\n  'glb'\n);\n\nmodule.exports = config;\n```\n\n### Step 5: Create an AR Component\nCreate an AR component (e.g., `ArComponent.js`) with the following code:\n\n```javascript\nimport React, { useState } from \"react\";\nimport {\n  ViroARScene,\n  ViroTrackingStateConstants,\n  Viro3DObject,\n  ViroAmbientLight\n} from \"@reactvision/react-viro\";\n\nconst ArComponent = (props) =\u003e {\n  const [trackingInitialized, setTrackingInitialized] = useState(false);\n  const [duckScale, setDuckScale] = useState([0.1, 0.1, 0.1]);\n\n  function onInitialized(state, reason) {\n    console.log(\"guncelleme\", state, reason);\n    if (state === ViroTrackingStateConstants.TRACKING_NORMAL) {\n      setTrackingInitialized(true);\n    }\n  }\n\n  function handleClick() {\n    console.log(\"Clicking on duck!\");\n  }\n\n  function handleDrag(dragToPos) {\n    console.log(\"Dragged to position:\", dragToPos);\n  }\n\n  function handlePinch(pinchState, scaleFactor, source) {\n    if (pinchState === 3) { // Pinch end\n      setDuckScale([\n        duckScale[0] * scaleFactor,\n        duckScale[1] * scaleFactor,\n        duckScale[2] * scaleFactor\n      ]);\n    }\n  }\n\n  return (\n    \u003cViroARScene onTrackingUpdated={onInitialized}\u003e\n      \u003cViroAmbientLight color=\"#FFFFFF\" /\u003e\n      {trackingInitialized \u0026\u0026 (\n        \u003cViro3DObject\n          source={{\n            uri: \"https://github.com/KhronosGroup/glTF-Sample-Models/blob/main/2.0/Duck/glTF-Binary/Duck.glb?raw=true\"\n          }}\n          position={[0, 0, -1]}\n          scale={duckScale}\n          type=\"GLB\"\n          onClick={handleClick}\n          onDrag={handleDrag}\n          onPinch={handlePinch}\n        /\u003e\n      )}\n    \u003c/ViroARScene\u003e\n  );\n};\n\nexport default ArComponent;\n```\n\n\n### Step 6: Create an AR Screen\nCreate an AR screen (e.g., `ARScreen.js`) with the following code:\n\n```javascript\nimport React from \"react\";\nimport { ViroARSceneNavigator } from \"@reactvision/react-viro\";\nimport ArComponent from \"../components/ar/ArComponent\";\n\nexport default function ARScreen() {\n  return (\n    \u003cViroARSceneNavigator\n      initialScene={{ scene: ArComponent }}\n      style={{ flex: 1 }}\n    /\u003e\n  );\n}\n```\n\n### Step 7: Add AR Screen to Routes\nAdd the AR screen to your routes and use a router to launch it. Example code:\n\n```javascript\n\u003cStack.Screen name=\"ar\" options={{ headerShown: false }} /\u003e\n\nconst router = useRouter();\n\nconst handleArScene = () =\u003e {\n  router.push(\"/ar\");\n};\n```\n\n### Step 8: Build the App\nRun the following command to build the app:\n\n```bash\neas build --profile development --platform android\n```\n\n\n### Step 9: Start the Development Server\nFinally, start the development server using:\n\n```bash\nnpx expo start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaid-aabilla%2Faugmented-reality-react-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaid-aabilla%2Faugmented-reality-react-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaid-aabilla%2Faugmented-reality-react-native/lists"}