blinkid-react-native
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -30,2 +30,3 @@ 'use strict'; | ||
export const USDLKeys = require('./keys/usdl_keys') | ||
export const EUDLKeys = require('./keys/eudl_keys') | ||
export const EUDLKeys = require('./keys/eudl_keys') | ||
export const MYKADKeys = require('./keys/mykad_keys') |
{ | ||
"name": "blinkid-react-native", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "A small and powerful ID card scanning library. Powered by MicroBlink (www.microblink.com).", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -37,2 +37,18 @@ # BlinkID SDK wrapper for React Native | ||
Add microblink maven repository to project level build.gradle: | ||
``` | ||
allprojects { | ||
repositories { | ||
// don't forget to add maven and jcenter | ||
mavenLocal() | ||
jcenter() | ||
// ... other repositories your project may need | ||
maven { url "http://maven.microblink.com" } | ||
} | ||
} | ||
``` | ||
## Demo | ||
@@ -87,9 +103,14 @@ | ||
```javascript | ||
/** | ||
* Sample React Native App for BlinkID | ||
* https://github.com/BlinkID/blinkid-react-native | ||
*/ | ||
/** | ||
/** | ||
* Use these recognizer types | ||
* Available: RECOGNIZER_USDL, RECOGNIZER_MRTD, RECOGNIZER_EUDL, RECOGNIZER_DOCUMENT_FACE | ||
* RECOGNIZER_USDL - scans barcodes located on the back of US driver's license | ||
* RECOGNIZER_USDL - scans barcodes located on the back of US driver license | ||
* RECOGNIZER_MRTD - scans Machine Readable Travel Document, contained in various IDs and passports | ||
* RECOGNIZER_EUDL - scans the front of European driver's license | ||
* RECOGNIZER_EUDL - scans the front of European driver license | ||
* RECOGNIZER_MYKAD - scans the front of Malaysian ID | ||
* RECOGNIZER_DOCUMENT_FACE - scans documents with face image and returns document images | ||
@@ -101,6 +122,6 @@ */ | ||
* available: | ||
* "useFrontCamera" : if it's set to false, back camera is used, else front | ||
* "shouldReturnCroppedImage": if true, cropped images in the recognition process will be returned | ||
* "shouldReturnSuccessfulImage": if true, image on which scan gave valid scanning result will be returned | ||
* "recognizers": array which contains recognizers that will be activated | ||
* useFrontCamera : if it is set to false, back camera is used, else front | ||
* shouldReturnCroppedImage : if true, cropped images in the recognition process will be returned | ||
* shouldReturnSuccessfulImage : if true, image on which scan gave valid scanning result will be returned | ||
* recognizers : array which contains recognizers that will be activated | ||
*/ | ||
@@ -110,9 +131,10 @@ | ||
* Scan method returns scan fields in JSON format and image(s) (image is returned as Base64 encoded JPEG) | ||
* "scanningResult.resultImageCropped" : cropped document image | ||
* "scanningResult.resultImageSuccessful" : full image on which scan gave valid scanning result | ||
* "scanningResult.resultList" : array of scanning results in JSON format (each activated recognizer can produce its own result) | ||
* scanningResult.resultImageCropped : cropped document image | ||
* scanningResult.resultImageSuccessful : full image on which scan gave valid scanning result | ||
* scanningResult.resultList : array of scanning results in JSON format (each activated recognizer can produce its own result) | ||
*/ | ||
import React, { Component } from 'react'; | ||
import {BlinkID, MRTDKeys, USDLKeys, EUDLKeys} from 'blinkid-react-native'; | ||
import {BlinkID, MRTDKeys, USDLKeys, EUDLKeys, MYKADKeys} from 'blinkid-react-native'; | ||
import { | ||
@@ -133,3 +155,3 @@ AppRegistry, | ||
// android license key for applicationID: com.blinkidreactnative | ||
android: 'QZV7NMCQ-L3BUIQ2R-VGM4QE5P-RLA2TGFM-2QZO73JY-L3DTQXWH-HBPMOOC6-Y44CTRRX' | ||
android: 'VF2QEAKE-IZYWGJZJ-6T43WTEY-VTKDF37N-HBPMOOC6-Y44F5RZY-L3DTQXWH-HBPLB7DZ' | ||
}) | ||
@@ -168,3 +190,5 @@ | ||
// scans EUDL (EU Driver License) | ||
BlinkID.RECOGNIZER_EUDL | ||
BlinkID.RECOGNIZER_EUDL, | ||
// scans MyKad (Malaysian ID) | ||
BlinkID.RECOGNIZER_MYKAD | ||
] | ||
@@ -236,2 +260,18 @@ }) | ||
} else if (recognizerResult.resultType == "MyKad result") { | ||
var fields = recognizerResult.fields | ||
// MYKADKeys are keys from keys/mykad_keys.js | ||
resultsFormattedText += /** Personal information */ | ||
"Full name: " + fields[MYKADKeys.FullName] + fieldDelim + | ||
"NRIC Number: " + fields[MYKADKeys.NricNumber] + fieldDelim + | ||
"Address: " + fields[MYKADKeys.Address] + fieldDelim + | ||
"City: " + fields[MYKADKeys.AddressCity] + fieldDelim + | ||
"State: " + fields[MYKADKeys.AddressState] + fieldDelim + | ||
"Street: " + fields[MYKADKeys.AddressStreet] + fieldDelim + | ||
"Zip code: " + fields[MYKADKeys.AddressZipCode] + fieldDelim + | ||
"Date of birth: " + fields[MYKADKeys.DateOfBirth] + fieldDelim + | ||
"Religion: " + fields[MYKADKeys.Religion] + fieldDelim + | ||
"Sex: " + fields[MYKADKeys.Sex] + fieldDelim; | ||
} else if (recognizerResult.resultType == "DocumentFace result") { | ||
@@ -325,2 +365,3 @@ // document face recognizer returns only images | ||
+ **RECOGNIZER_EUDL** - scans the front of European driver's license | ||
+ **RECOGNIZER\_MYKAD** - scans the front of Malaysian ID | ||
+ **RECOGNIZER\_DOCUMENT\_FACE** - scans documents with face image and returns document images | ||
@@ -335,1 +376,6 @@ | ||
## FAQ | ||
**Can I create a custom UI overlay?** | ||
Yes you can, but you will have to implement it natively for android and ios, you can see native implementation guides [here(Android)](https://github.com/BlinkID/blinkid-android#recognizerView) and [here(ios)](https://github.com/BlinkID/blinkid-ios/wiki/Customizing-Camera-UI#steps-for-providing-custom-camera-overlay-view). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
164545
22
879
373
1