Skip to content

Latest commit

 

History

History
60 lines (31 loc) · 2.1 KB

SETUP.md

File metadata and controls

60 lines (31 loc) · 2.1 KB

React ARKit SETUP

Getting started

$ npm install react-native-react-arkit --save

Mostly automatic installation

$ react-native link react-native-react-arkit

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-react-arkit and add RNReactArkit.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNReactArkit.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Configuring iOS Platform

ie. How to deal with Xcode stuff...

Camera Permissions

For our app to be able to launch the AR Scene, we need to ask the user for the permission to the phone camera. Before starting the following steps, launch your project on Xcode.

You can do this by, doing the following within the root of your project directory

open ios/<ProjectName>.xcodeproj/

Once the project is open on Xcode, find the Info.plist file:

Click on one of the + signs that appear when you hover over a row. Add Privacy - Camera Usage Description as the key, and This application will use the camera for Augmented Reality. as the value.

You should be good to go!

Making the project Swift compatible

Since React-Native apps are by default Obj-c apps, we need to tell Xcode what Swift compiler to use for our Swift files. The easiest way to do this is to simply add a blank .swift file into the project.

File > New > File... >

This prompt should show up:

Make sure Swift File is selected. Press Next. Give the file an arbitrary name, or keep the default File.swift. In the next prompt you can choose not to create the Bridging Header file.

That's it!