All Projects → dealrinc → cordova-gmv-barcode-scanner

dealrinc / cordova-gmv-barcode-scanner

Licence: MIT license
A Cordova barcode scanning plugin based on the Google Mobile Vision library for iOS & Android.

Programming Languages

java
68154 projects - #9 most used programming language
objective c
16641 projects - #2 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to cordova-gmv-barcode-scanner

cordova-plugin-flurryanalytics
Adds support for all that Flurry Analytics flavored goodness to your Cordova based apps
Stars: ✭ 23 (-52.08%)
Mutual labels:  cordova, cordova-android, cordova-plugin, cordova-ios
cordova-plugin-webpack
Integrate webpack into your Cordova workflow.
Stars: ✭ 61 (+27.08%)
Mutual labels:  cordova, cordova-android, cordova-plugin, cordova-ios
cordova-plugin-zeep
Zip compression/decompression for the cordova/phonegap platform
Stars: ✭ 27 (-43.75%)
Mutual labels:  cordova, cordova-android, cordova-plugin, cordova-ios
JiaCordova
在Cordova及插件的基础上封装一些常用的功能,不断更新中
Stars: ✭ 35 (-27.08%)
Mutual labels:  cordova, cordova-plugin, cordova-ios
cordova-plugin-android-window-background
Simple Cordova plugin to set Android window background on start-up 🎨 🍭
Stars: ✭ 15 (-68.75%)
Mutual labels:  cordova, cordova-android, cordova-plugin
cordova-plugin-example
Example Cordova plugin for iOS and Android to support blog post.
Stars: ✭ 15 (-68.75%)
Mutual labels:  cordova-android, cordova-plugin, cordova-ios
Create-a-custom-Cordova-plugin
How to create a custom cordova plugin and bridge it between your native code and a new or existing Cordova project
Stars: ✭ 32 (-33.33%)
Mutual labels:  cordova, cordova-android, cordova-plugin
cordova-plugin-today-widget
Add a today widget app extension target to your cordova project.
Stars: ✭ 51 (+6.25%)
Mutual labels:  cordova, cordova-plugin, cordova-ios
cordova-plugin-ironsource-ads
Cordova plugin for IronSource ads
Stars: ✭ 17 (-64.58%)
Mutual labels:  cordova-android, cordova-plugin, cordova-ios
Cordova Plugin Touch Id
💅 👱‍♂️ Forget passwords, use a fingerprint scanner!
Stars: ✭ 209 (+335.42%)
Mutual labels:  cordova, cordova-plugin
cordova-fonts
Cordova plugin for enumerating fonts on a mobile device
Stars: ✭ 14 (-70.83%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Fingerprint Aio
👆 📱 Cordova Plugin for fingerprint sensors (and FaceID) with Android and iOS support
Stars: ✭ 236 (+391.67%)
Mutual labels:  cordova, cordova-plugin
Vue Objccn
🔥 Use Vue.js to develop a cross-platform full stack application / 用 Vue.js 开发的跨三端应用
Stars: ✭ 1,993 (+4052.08%)
Mutual labels:  cordova, cordova-ios
cordova-plugin-purchases
Cordova in-app purchases and subscriptions made easy.
Stars: ✭ 52 (+8.33%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Audioinput
This iOS/Android Cordova/PhoneGap plugin enables audio capture from the device microphone, by in near real-time forwarding audio to the web layer of your application. A typical usage scenario for this plugin would be to use the captured audio as source for a web audio node chain, where it then can be analyzed, manipulated and/or played.
Stars: ✭ 137 (+185.42%)
Mutual labels:  cordova, cordova-plugin
ZeroConf
ZeroConf plugin for Cordova/Phonegap 3.0
Stars: ✭ 39 (-18.75%)
Mutual labels:  cordova-android, cordova-plugin
cordova-study
📱 Cordova学习记录,Cordova插件的使用,热更新、media、device、集成x5内核等等。
Stars: ✭ 19 (-60.42%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-downloadmanager
A Cordova plugin to download file in system's default download manager
Stars: ✭ 45 (-6.25%)
Mutual labels:  cordova, cordova-plugin
hms-cordova-plugin
This repo contains all of Cordova HMS plugins.
Stars: ✭ 78 (+62.5%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Add Swift Support
🔨 Swiftify your Cordova app !
Stars: ✭ 108 (+125%)
Mutual labels:  cordova, cordova-plugin

cordova-gmv-barcode-scanner

Purpose of this Project

The purpose of this project is to provide a barcode scanner utilizing the Google Mobile Vision library for the Cordova framework on iOS and Android. The GMV library is incredibly performant and fast in comparison to any other barcode reader that I have used that are free. Additionally, I built it to perform live validity checks on VIN numbers for use as a VIN scanner and for drivers license scanning through the PDF 417 barcode on most identification cards.

iPhone X Screenshot

You can also check out a sample application here if you'd like to see the scanner in action.

Installation

cordova plugin add cordova-gmv-barcode-scanner

Usage

To use the plugin simply call window.plugins.GMVBarcodeScanner.scan(options, callback). See the sample below.

window.plugins.GMVBarcodeScanner.scan({}, function(err, result) { 
    
	//Handle Errors
	if(err) return;
	
	//Do something with the data.
	alert(result);
	
});

You can also call scanLicense or scanVIN to use the other scanning abilities. Note that the only options available to these functions are width and height of the barcode detector.

window.plugins.GMVBarcodeScanner.scanVIN(function(err, result) {
	//Handle Errors
	if(err) return;
	
	//Do something with the data.
	alert(result);
	
}, { width: .5, height: .7 });
window.plugins.GMVBarcodeScanner.scanLicense(function(err, result) {
	//Handle Errors
	if(err) return;
	
	//Do something with the data.
	alert(result);
	
}, { width: .5, height: .7 });

Output

For the scan and scanVIN functions the output will be a plain string of the value scanned. For scanLicense the result will be an object something along the lines of

{
    "LicenseNumber": "123456789",
    "FirstName": "Johnny",
    "MiddleName": "Allen",
    "LastName": "Appleseed",
    "BirthDate": "1/31/1990",
    "LicenseExpiration": "1/31/2025",
    "Address": {
        "Address": "1234 Main St.",
        "City": "Fairyland",
        "State": "AB",
        "Zip": "12345"
    },
    "LicenseState":"AB"
}

Plugin Options

The default options are shown below. Note that the detectorSize.width and detectorSize.height values must be floats. If the values are greater than 1 then they will not be visible on the screen. Use them as decimal percentages to determine how large you want the scan area to be.

var options = {
	types: {
		Code128: true,
		Code39: true,
		Code93: true,
		CodaBar: true,
		DataMatrix: true,
		EAN13: true,
		EAN8: true,
		ITF: true,
		QRCode: true,
		UPCA: true,
		UPCE: true,
		PDF417: true,
		Aztec: true
	},
	detectorSize: {
		width: .5,
		height: .7
	}
}

Android Quirks

The detectorSize option does not currently exclude the area around the detector from being scanned, which means that anything shown on the preview screen is up for grabs to the barcode detector. On iOS this is done automatically.

VIN Scanning

VIN scanning works on both iOS and Android and utilizes both Code39 and Data Matrix formats. The scanner has a VIN checksum validator that ensures that the 9th VIN digit is correctly calculated. If it is not, the barcode will simply be skipped and the scanner will continue until it finds a valid VIN.

Driver's License Scanning

Driver's license scanning works on both iOS and Android and scans the PDF417 format and decodes according to the AAMVA specification. It only pulls a few fields, but I believe they are the most important. The decoding is done in the Javascript portion of this plugin which means you could modify it if you'd like.

Commercial Use

This VIN scanner is the primary reason I built out this project, and is used in a commercial application for my company. Additionally, PDF417 scanning on drivers licenses is a massive benefit to the speed of the GMV library. I'd ask that any competitors don't utilize the VIN scanner for vehicles or PDF417 scanner for drivers licenses in applications that offer similar service to the dealr.cloud application.

Maybe it's stupid for me to ask this, but I wanted to make this project MIT and open because I have always had trouble finding a good scanner for cordova and I wanted to help out other developers. Figured a bit of an ask is in order! :-)

Project Info

I am not a native developer and basically hacked both of the implementations together. That being said, in testing the plugins look fantastic, significantly more modern than other scanners, and they scan incredibly quickly. Please send @forrestmid a private message, or just submit a pull request, if you have any inclination towards assisting the development of this project!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].