WalobwaD / RN-DeepAR

Augmented reality with React Native and DeepAR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Native + DeepAR

Cloning and running the Project

# Clone this repository
$ git clone

# Go into the repository
$ cd react-native-deepar
  • Before running the project, you need to adjust some native files. Follow the instructions below:

Android Devices

  • Go to the file: android/app/src/main/AndroidManifest.xml and add the following lines:
<uses-permission android:name="android.permission.CAMERA" />
<!--Optional if you also want to record the audio-->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
  • Inside your android/build.gradle file, make sure you have the following configuration:
buildscript {
    ext {
        buildToolsVersion = "33.0.0"
        minSdkVersion = 23
        compileSdkVersion = 33
        targetSdkVersion = 33
    }
}
   
  • Install all dependencies using the command:
$ yarn
  • Make sure you are connected to a physical device before running the project.
  • Run this command to check for connected devices.
$ adb devices
  • Run the project using the command:
$ yarn android

iOS Devices

  • Go to the file: ios/{YourProjectName}/Info.plist and add the following lines:
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) needs access to your Camera.</string>

<!-- optionally, if you want to record audio: -->
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) needs access to your Microphone.</string>
   
  • Open your ios/YourProject.xcworkspace file in Xcode and update your iOS version to 11.0 minimum, like below:
Setting iOS Version from Xcode
Xcode Setting iOS Version
Follow steps in the picture.
- Add `DeepAR.xcframework` to Build Phases:
Add DeepAR to Build Phases (1) Add DeepAR to Build Phases (2)
Add DeepAR to Build Phases in Xcode Add DeepAR to Build Phases in Xcode
Follow steps in the picture. Follow steps in the picture.
  • Navigate to your ios folder and install the bundler and pods using the commands:
$ cd ios 

$ bundle install

$ bundle exec pod install
  • Make sure you are connected to a physical device via usb before running the project.
  • Run this command to check for connected devices.
$ xcrun simctl list devices
  • Make sure you're in the root folder of the project and run the command below to start the bundler
$ yarn ios

About

Augmented reality with React Native and DeepAR


Languages

Language:Java 40.2%Language:TypeScript 24.8%Language:Ruby 13.1%Language:Objective-C 12.9%Language:JavaScript 4.6%Language:Objective-C++ 4.2%