react-native-quikkly-scanner
Getting started
$ npm install react-native-quikkly-scanner --save
Mostly automatic installation
$ react-native link react-native-quikkly-scanner
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.getwala.quikkly.reactnative.ReactNativeQuikklyScannerPackage;
to the imports at the top of the file - Add
new ReactNativeQuikklyScannerPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-react-native-quikkly-scanner'project(':react-native-react-native-quikkly-scanner').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-react-native-quikkly-scanner/android') - Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile - Add your quikkly api key to your appManifest
- Add the ScanQuikklyCode Activity to your manifest
Usage
Scanning
;// Opens the quikkly scanner. On code detection returns a promise with the code.ReactNativeQuikklyScanner;
Generating
The imagePath needs to be a path on the device where the image is stored, I would recommend using react-native-cached-image'
;const ImageCacheProvider = CachedImageImageCacheProvider;ImageCacheProvideroptions ="templateName" : "" //string defaults to "template0002style5""quikklyCode" : "" // string. This is what the scannable will return when scanned"backgroundColor":"" // will default to "#5cb7a6""borderColor":"" // defaults to "#ffffff""dataColor":"" // defaults to #000000""maskColor":"" // defaults to "#5cb7a6""overlayColor":"" // defaults to // "#ffffff""imagePath": "" // defaults to "https://s3-eu-west-1.amazonaws.com/qkly-service-albums/temp_icons/squiddy.png"