Ionic cordova sample to use cordova-plugin-scanzy-barcodescanner
The following plugins are included:
- cordova-plugin-scanzy-barcodescanner To learn how to install cordova-plugin-scanzy-barcodescanner and use the scan feature, check our official documentation
- Install Node.js v14 or higher, with Node Package Manager v7.24 or higher
- Android development: Install Android Studio
- iOS development: Install XCode
- This project uses Ionic as an app development platform and the Ionic CLI.
With Node and NPM set up, let's install the Ionic and Cordova CLI.
npm install -g ionic cordova
Clone this repository:
git clone https://github.com/ScanzyLLC/scanzy-barcodescanner-sample-ionic-cordova.git
Change to the root directory of the project:
cd scanzy-barcodescanner-sample-ionic-cordova
Install all dependencies:
npm i
Add native platforms to the project:
ionic cordova platform add ios
ionic cordova platform add android
Build the web assets:
ionic cordova build ios
ionic cordova build android
Copy assets to Cordova platforms, preparing them for native builds:
ionic cordova prepare ios
ionic cordova prepare android
- Open the workspace file ScanzyBarcodeScannerSDKSampleReactNative.xcworkspace (not .xcodeproj) from the ios * directory in Xcode.
- Adjust Provisioning and Signing settings.
- Choose one simulator or local device to run the app.
- Open the project located in platforms/android using Android Studio.
- Select File --> Sync Project with Gradle Files
- If you experience the 'Unable to determine Android SDK directory' build error: Create new File --> Project--> Platform --> android--> local.properties. Then add sdk.dir={YOUR_SDK_PATH} (example: sdk.dir=/Users/admin/Library/Android/sdk) to the file, and try to sync again.