Installation
To integrate React Native MediaPipe into your project, follow these simple steps.
Requirements
- Gradle minimum SDK 24 or higher
- Android-SDK Version 26 or higher
- iOS 12 or higher
- Open Terminal or Command Prompt: Open your terminal or command prompt application.
- Navigate to Your Project Directory: Navigate to your React Native project directory.
- Install React Native MediaPipe: Run the following command to install React Native MediaPipe and its dependencies:
Using npm
npm install react-native-mediapipe react-native-vision-camera react-native-worklets-core
Using yarn
yarn add react-native-mediapipe react-native-vision-camera react-native-worklets-core
- Configuring Babel: Navigate to the 'babel.config.js' file and add:
module.exports = {
presets: ['module:@react-native/babel-preset'],
plugins: [['react-native-worklets-core/plugin']],
};
- Configuring Gradle: Navigate to the 'android/build.gradle' file and change minSdkVersion to 24
warning
Gradle minimum SDK must be 24 or higher to run
buildscript {
ext {
...
minSdkVersion = 24
...
}
...
}
Configuring to your Operating System
- Android
- iOS
- Give Permissions: Navigate to your AndroidManifest.xml file and add:
<uses-permission android:name="android.permission.CAMERA" />
<!-- optionally, if you want to record audio: -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
- Give Permissions: Navigate to your info.plist file in the outermost tag:
<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>
- Terminal Commands: In your terminal run the following commands
cd ios
bundle install
pod install
info
You will only need to run the bundle install command once.