{"_id":"5bec8a15287d1b00426efe4e","project":"578c4badbd223d2000cc1441","version":{"_id":"5bec8a15287d1b00426efe54","project":"578c4badbd223d2000cc1441","__v":0,"forked_from":"5ba2b5747091250003437507","createdAt":"2018-04-23T20:03:35.726Z","releaseDate":"2018-04-23T20:03:35.726Z","categories":["5bec8a15287d1b00426efdc6","5bec8a15287d1b00426efdc7","5bec8a15287d1b00426efdc8","5bec8a15287d1b00426efdc9","5bec8a15287d1b00426efdca","5bec8a15287d1b00426efdcb","5bec8a15287d1b00426efdcc","5bec8a15287d1b00426efdcd","5bec8a15287d1b00426efdce"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.12.0","version":"2.12.0"},"category":{"_id":"5bec8a15287d1b00426efdc7","version":"5bec8a15287d1b00426efe54","project":"578c4badbd223d2000cc1441","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-03-17T18:59:29.780Z","from_sync":false,"order":1,"slug":"getting-started-ios","title":"iOS - Platform Setup"},"user":"57bb7e47afc18c0e00529cf3","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-08-14T19:21:00.417Z","link_external":false,"link_url":"","sync_unique":"","hidden":true,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":7,"body":"[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Xcode Beta and a Paid Apple Developer account is required to use ARKit 2.0 Features\",\n  \"body\": \"Due to App Store restrictions, we can not release a Testbed application with ARKit 2.0 Features, as a result, to use ARKit 2.0 Features, you'll need to follow the instructions below to setup your device and Xcode Beta to build your application.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Have you already set up Xcode?\",\n  \"body\": \"Run through all the steps in the [Set up Xcode with ViroReact](doc:starting-a-new-viro-project-1) guide before running through this one.\"\n}\n[/block]\n# 1. Install Xcode Beta\n\nGo to this link and install Xcode 10 Beta: https://developer.apple.com/xcode/downloads/\n\n# 2. Install iOS 12.0 Beta on your Device\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"If you do this, you can no longer install to the device using previous versions of Xcode (non-Beta).\"\n}\n[/block]\nOn your iOS device, navigate to this page: https://developer.apple.com/download/ and install the Configuration Profile for iOS 12.0 Beta\n\n# 3. Download the zipped `npm` package (.tgz) from here:\n\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Version\",\n    \"h-1\": \"Date\",\n    \"h-2\": \"Link\",\n    \"0-0\": \"react-viro 2.9.0\",\n    \"0-1\": \"08/14/18\",\n    \"0-2\": \"https://s3-us-west-2.amazonaws.com/viro/ViroBeta/react-viro-2.9.0.tgz\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n# 4. Install the downloaded `npm` package\n\n```\ncd </path/to/workspace/>\nnpm install react-viro-<version>.tgz\n```\n\n# 5. Update `rn-cli.config.js`\n\n`<workspace>/rn-cli.config.js`:\n\nAdd `\"arobject\"` to `getAssetExts()`\n\n# 6. Update RCTWebSocket Project\n\nRCTWebSocket Target -> Build Phases -> Link Binary With Libraries and replace the unresolved `libfishhook.a` with the correct one under RCTWebSocket.xcodeproj -> Products\n\nfrom: https://github.com/facebook/react-native/issues/19569\n\n# 7. Check out the new API's:\n\n## ViroARObjectMarker\n\nThis component has the exact same signature as [ViroARImageMarker](doc:viroarimagemarker) but its target uses the new \"Object\" target type.\n\nTo declare/create an \"Object\" target, use [ViroARTrackingTargets](doc:viroartrackingtargets) like so:\n\n```\nViroARTrackingTargets.createTargets({\n  coke_can : { // an Object Target\n    source : require('./res/coke_can.arobject'),\n    type : 'Object',\n  },\n  starry_night : { // an Image Target\n    source : require('./res/starry_night.jpg'),\n    orientation : \"Up\",\n    physicalWidth : 0.189,\n  }\n})\n``` \n\nYou can create an `.arobject` file through the instructions here (download the sample app, build it, scan your object, and send it to your computer): \nhttps://developer.apple.com/documentation/arkit/scanning_and_detecting_3d_objects?language=objc\n\n## Continuous Image Tracking\n\nARKit introduced a new API that enables continuous Image Tracking vs, what they now refer to as, Image Detection.\n\nThis is exposed in [ViroARSceneNavigator](doc:viroarscenenavigator)'s new `numberOfTrackedImages` property which takes in a number of images that should be tracked concurrently. For example, if this number is set to 3, then the first 3 images visible in a scene will be tracked. Even if there are 5 total `ViroARImageMarker`s only the first 3 will be tracked, if one marker leaves the view, then an untracked marker will then be tracked. Keep in mind that this number should be kept low as the higher the number, the worse the performance.","excerpt":"","slug":"enable-arkit-20-beta-features","type":"basic","title":"Enable ARKit 2.0 (Beta) Features"}

Enable ARKit 2.0 (Beta) Features


[block:callout] { "type": "danger", "title": "Xcode Beta and a Paid Apple Developer account is required to use ARKit 2.0 Features", "body": "Due to App Store restrictions, we can not release a Testbed application with ARKit 2.0 Features, as a result, to use ARKit 2.0 Features, you'll need to follow the instructions below to setup your device and Xcode Beta to build your application." } [/block] [block:callout] { "type": "warning", "title": "Have you already set up Xcode?", "body": "Run through all the steps in the [Set up Xcode with ViroReact](doc:starting-a-new-viro-project-1) guide before running through this one." } [/block] # 1. Install Xcode Beta Go to this link and install Xcode 10 Beta: https://developer.apple.com/xcode/downloads/ # 2. Install iOS 12.0 Beta on your Device [block:callout] { "type": "danger", "title": "If you do this, you can no longer install to the device using previous versions of Xcode (non-Beta)." } [/block] On your iOS device, navigate to this page: https://developer.apple.com/download/ and install the Configuration Profile for iOS 12.0 Beta # 3. Download the zipped `npm` package (.tgz) from here: [block:parameters] { "data": { "h-0": "Version", "h-1": "Date", "h-2": "Link", "0-0": "react-viro 2.9.0", "0-1": "08/14/18", "0-2": "https://s3-us-west-2.amazonaws.com/viro/ViroBeta/react-viro-2.9.0.tgz" }, "cols": 3, "rows": 1 } [/block] # 4. Install the downloaded `npm` package ``` cd </path/to/workspace/> npm install react-viro-<version>.tgz ``` # 5. Update `rn-cli.config.js` `<workspace>/rn-cli.config.js`: Add `"arobject"` to `getAssetExts()` # 6. Update RCTWebSocket Project RCTWebSocket Target -> Build Phases -> Link Binary With Libraries and replace the unresolved `libfishhook.a` with the correct one under RCTWebSocket.xcodeproj -> Products from: https://github.com/facebook/react-native/issues/19569 # 7. Check out the new API's: ## ViroARObjectMarker This component has the exact same signature as [ViroARImageMarker](doc:viroarimagemarker) but its target uses the new "Object" target type. To declare/create an "Object" target, use [ViroARTrackingTargets](doc:viroartrackingtargets) like so: ``` ViroARTrackingTargets.createTargets({ coke_can : { // an Object Target source : require('./res/coke_can.arobject'), type : 'Object', }, starry_night : { // an Image Target source : require('./res/starry_night.jpg'), orientation : "Up", physicalWidth : 0.189, } }) ``` You can create an `.arobject` file through the instructions here (download the sample app, build it, scan your object, and send it to your computer): https://developer.apple.com/documentation/arkit/scanning_and_detecting_3d_objects?language=objc ## Continuous Image Tracking ARKit introduced a new API that enables continuous Image Tracking vs, what they now refer to as, Image Detection. This is exposed in [ViroARSceneNavigator](doc:viroarscenenavigator)'s new `numberOfTrackedImages` property which takes in a number of images that should be tracked concurrently. For example, if this number is set to 3, then the first 3 images visible in a scene will be tracked. Even if there are 5 total `ViroARImageMarker`s only the first 3 will be tracked, if one marker leaves the view, then an untracked marker will then be tracked. Keep in mind that this number should be kept low as the higher the number, the worse the performance.