Comments (14)
Hello @tuananhluong
Are you able to share your index.js file? You can send it on [email protected]
Regards
from blinkid-react-native.
Hello @tuananhluong ,
Can you please try to set index.js on following way:
try {
var malayIdRecognizer = new BlinkIDReactNative.MyKadFrontRecognizer();
malayIdRecognizer.returnFaceImage = true;
malayIdRecognizer.returnFullDocumentImage = true;
var malayIdSuccessFrameGrabber = new BlinkIDReactNative.SuccessFrameGrabberRecognizer(malayIdRecognizer);
const scanningResults = await BlinkIDReactNative.BlinkID.scanWithCamera(
new BlinkIDReactNative.DocumentOverlaySettings(),
new BlinkIDReactNative.RecognizerCollection([malayIdSuccessFrameGrabber]),
licenseKey
);
if (scanningResults) {
let newState = {
showImageDocument: false,
resultImageDocument: '',
showImageFace: false,
resultImageFace: '',
results: '',
showSuccessFrame: false,
successFrame: ''
};
for (let i = 0; i < scanningResults.length; ++i) {
let localState = this.handleResult(scanningResults[i]);
newState.showImageDocument = newState.showImageDocument || localState.showImageDocument;
if (localState.resultImageDocument) {
newState.resultImageDocument = localState.resultImageDocument;
}
newState.showImageFace = newState.showImageFace || localState.showImageFace;
if (localState.resultImageFace) {
newState.resultImageFace = localState.resultImageFace;
}
newState.results += localState.results;
newState.showSuccessFrame = newState.showSuccessFrame || localState.showSuccessFrame;
if (localState.successFrame) {
newState.successFrame = localState.successFrame;
}
}
newState.results += '\n';
this.setState(newState);
}
} catch (error) {
console.log(error);
this.setState({ showImageDocument: false, resultImageDocument: '', showImageFace: "", resultImageFace: '', results: 'Scanning has been cancelled', showSuccessFrame: false,
successFrame: ''});
}
}
and handle results on following way:
let fieldDelim = ";\n";
var localState = {
showImageDocument: false,
resultImageDocument: '',
showImageFace: '',
resultImageFace: '',
results: '',
showSuccessFrame: false,
successFrame: ''
};
if (result instanceof BlinkIDReactNative.MyKadFrontRecognizerResult) {
localState.results +=
"NRIC number:" + result.nricNumber + fieldDelim +
"First name:" + result.ownerFullName + fieldDelim;
//add desired results from the https://github.com/BlinkID/blinkid-phonegap/blob/master/BlinkID/www/blinkIdScanner.js#L5772
if (result.faceImage) {
localState.showImageFace = true;
localState.resultImageFace = 'data:image/jpg;base64,' + result.faceImage;
}
} else if (result instanceof BlinkIDReactNative.SuccessFrameGrabberRecognizerResult) {
// first handle slave result, and then add success frame image
localState = this.handleResult(result.slaveRecognizerResult);
// success frame is returned as Base64 encoded JPEG
if (result.successFrame) {
localState.showSuccessFrame = true
localState.successFrame = 'data:image/jpg;base64,' + result.successFrame;
}
}
return localState;
}
Best regards,
Ivan
from blinkid-react-native.
Thank you @culoi
I follow your suggestion and the console log error as below:
TypeError: Cannot read property 'scanWithCamera' of undefined
at BlinkIDWrapper.scanWithCamera$ (blob:http://localhost:8081/74af9f55-7f45-4643-9597-8b5ca9d9505a:62520:95)
at tryCatch (blob:http://localhost:8081/74af9f55-7f45-4643-9597-8b5ca9d9505a:16727:19)
at Generator.invoke [as _invoke] (blob:http://localhost:8081/74af9f55-7f45-4643-9597-8b5ca9d9505a:16900:24)
at Generator.prototype.(anonymous function) [as next] (blob:http://localhost:8081/74af9f55-7f45-4643-9597-8b5ca9d9505a:16770:23)
at tryCatch (blob:http://localhost:8081/74af9f55-7f45-4643-9597-8b5ca9d9505a:16727:19)
at invoke (blob:http://localhost:8081/74af9f55-7f45-4643-9597-8b5ca9d9505a:16803:22)
at blob:http://localhost:8081/74af9f55-7f45-4643-9597-8b5ca9d9505a:16831:13
at tryCallTwo (blob:http://localhost:8081/74af9f55-7f45-4643-9597-8b5ca9d9505a:16065:7)
at doResolve (blob:http://localhost:8081/74af9f55-7f45-4643-9597-8b5ca9d9505a:16229:15)
at new Promise (blob:http://localhost:8081/74af9f55-7f45-4643-9597-8b5ca9d9505a:16088:5)
from blinkid-react-native.
Hi @culoi
I sent email to [email protected] with my source code.
Thank you so much.
Best regards,
Tuan
from blinkid-react-native.
@tuananhluong were you ever able to resolve this on your side? I'm running into the same issue.
from blinkid-react-native.
Hi @tuananhluong,
does our sample app work for you? It can be created by running initReactNativeDemoApp.sh.
from blinkid-react-native.
running into same issue, android 10.
also if its test run on react native 0.60 or above, why do we still need perform linking, 0.60 already provide auto linking
from blinkid-react-native.
the script and demo video only shows for ios, how to install demo app for android
from blinkid-react-native.
my previous experience with such error is that the native modules are not linked properly in MainApplication.java.
However in this doc, cant find any guide to import proper package to be added in react's package list. please help troubleshoot this issue.
on the current project, running linking shows error. probably bcz the proj is running on 0.61.2
from blinkid-react-native.
Hi @jacky-ew,
Our plugin works with React Native v0.61.5.
The initReactNativeDemoApp.sh creates sample project for Android and iOS. Also, in that script you can see commands for adding the plugin to your application. Video shows instructions for iOS and Android, Android part starts at 02:23.
To test our plugin run the script and sample app:
// run scritp to create sample project
./initReactNativeDemoApp.sh
// position to created sample project
cd BlinkIDReactNative
// run the app
react-native run-android
Does the sample app work for you?
from blinkid-react-native.
Hi @jacky-ew,
also, when including plugin to your application, don't forget to add Microblink maven repository to project level build.gradle: https://github.com/BlinkID/blinkid-react-native#android
from blinkid-react-native.
Hi @jacky-ew
As this issue is inactive, I am closing it.
However, if this is still an open issue for you, feel free to re-open this one or create a new issue.
Also, you can always contact us directly at [email protected] for any additional questions.
Regards,
Milan
from blinkid-react-native.
Hi sorry for the late update, im no longer facing the issue,
i added the maven at wrong line in gradle file
from blinkid-react-native.
Hi @jacky-ew
Thank you for the feedback.
We are glad to hear that your issue has been resolved.
Since you fixed the issue, I am closing it.
Regards,
Milan
from blinkid-react-native.
Related Issues (20)
- Support for localisation in react-native wrapper? HOT 4
- type declaration for BlinkId HOT 7
- Android app crash - Using native module with overlay HOT 1
- For certain ID cards (german) result is empty
- Execution failed for task ':app:checkDebugAarMetadata'. HOT 3
- Problem compiling on IOS ^ property 'signResult' not found on object of type 'MBUsdlCombinedRecognizer *' HOT 4
- Customize camera Re HOT 6
- iOS crash when using DocumentVerificationOverlaySettings HOT 1
- Android app build fail: resource android:attr/lStar not found HOT 3
- Cannot build Sample app on Android due to > Task :app:mergeDebugAssets FAILED HOT 1
- iPhone 14 scanning problems HOT 12
- [Android] AAPT: error: resource android:attr/lStar while building release apk HOT 1
- Changing phone orientation while scanning turns off flashlight HOT 4
- Close the scanner programatically
- The Camera permission denied screen has some style issues HOT 1
- Close camera programatically HOT 4
- Status of this repo? HOT 2
- This license is invalid for version 6.1. It is valid only for licensee 'packageName', for product 'BlinkID' on platform 'Android' up to version 5.27. HOT 1
- IdBarcodeRecognizer TimeOut. HOT 2
- Faltal exception NSInvalidArgumentException HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blinkid-react-native.