Installation
Vasern is available on Android and iOS. The following steps will help you install Vasern into your React Native project.
Install Vasern
Make sure you have created React Native app. Navigate to React Native directory, and be ready to run commands on Terminal (MacOS) or Command Promp (Window).
1. Install using NPM:
$ npm install --save vasern
2. Link Vasern library to your project:
Automatic linking - for iOS and Android, run command:
$ react-native link vasern
Manually - for iOS:
Browse to "node_packages/vasern/vasern/ios", and drag "Vasern.xcodeproj" to "Libraries" directory on your project in XCode.
Add "libVasern.a" to "Build Phase" > "Link Binary with Libraries"
Manual linking - for Android:
Open file
android/app/build.gradle
from your android main app directory, addvasern
dependency:dependencies { + implementation project(':vasern') implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" implementation "com.facebook.react:react-native:+" // From node_modules }
Open file
android/setting.gradle
include ':app' + include ':vasern' + project(':vasern').projectDir = new File(rootProject.projectDir, '../node_modules/vasern/android')
Open
android/app/src/main/java/com/your-app-name/MainApplication.java
, add theRNVasernPackage
dependency.// Add this line after "import android.app.Application;" + import com.ambistudio.vasern.RNVasernPackage; // Add "new RNVasernPackage()" in "getPackages()" method @Override protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new MainReactPackage(), + new RNVasernPackage() ); }
3. Close Metro Bundle, rebuild and restart project.
What's next?
Learn about Supported Data Types or start Writing Schema.