Installation
$ npm install git+https://git@github.com/aseemnishad/react-native-android-scanner.git --save
- In
android/setting.gradle
...
include ':react-native-android-scanner'
project(':react-native-android-scanner').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-scanner/android')
include ':scanlibrary'
project(':scanlibrary').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-scanner/android/scanlibrary')
- In android/app/build.gradle
//New Updates :
...
dependencies {
...
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation project(':react-native-android-scanner')
implementation project(':scanlibrary')
}
Add to an Activity
Open your activity, usually located in android/app/src/main/java/[your package]/MainApplication.java.
Add import com.reactlibrary.RNReactNativeAndroidScannerPackage; to the imports at the top of the file.
Add new RNReactNativeAndroidScannerPackage() to the list returned by the getPackages() method.
Installation
$ npm install git+https://git@github.com/aseemnishad/react-native-android-scanner.git --saveandroid/setting.gradle//New Updates :
Add the required permissions in
AndroidManifest.xml:Change the required in MainActivity.java`:
Add to an Activity
Open your activity, usually located in
android/app/src/main/java/[your package]/MainApplication.java.Add
import com.reactlibrary.RNReactNativeAndroidScannerPackage;to the imports at the top of the file.Add
new RNReactNativeAndroidScannerPackage()to the list returned by thegetPackages()method.