Git Product home page Git Product logo

newlogic / smartscanner-capacitor Goto Github PK

View Code? Open in Web Editor NEW
10.0 7.0 3.0 50.36 MB

Capacitor plugin for the SmartScanner Core library to scan MRZ, NFC and barcodes

Home Page: https://www.npmjs.com/package/@idpass/smartscanner-capacitor

License: Apache License 2.0

Ruby 10.51% Java 13.57% Objective-C 7.19% Swift 16.19% JavaScript 5.95% TypeScript 13.13% Kotlin 33.47%
capacitor capacitor-plugin mrz-scanner barcode-scanner nfc-scanner hacktoberfest

smartscanner-capacitor's Introduction

SmartScanner Capacitor

Capacitor plugin for the SmartScanner Core library to scan MRZ, NFC and barcodes.

Installation

This plugin can be installed from NPM:

# Using npm
npm install @idpass/smartscanner-capacitor

# Using yarn
yarn add @idpass/smartscanner-capacitor

Usage

The plugin can be used through Capacitor's Plugins object, which is the registry of all available plugins.

import { Plugins } from '@capacitor/core';

const { SmartScannerPlugin } = Plugins;

MRZ scanning example:

const result = await SmartScannerPlugin.executeScanner({
  action: 'START_SCANNER',
  options: {
    mode: 'mrz',
    mrzFormat: 'MRTD_TD1',
    config: {
      background: '#89837c',
      branding: false,
      isManualCapture: true,
      showGuide: true, // beta version 0.4.5-beta
    },
  },
});

NFC scanning example:

const result = await SmartScannerPlugin.executeScanner({
  action: 'START_SCANNER',
  options: {
    mode: 'nfc-scan',
    config: {
      background: '#89837c',
      branding: false,
      isManualCapture: false,
    },
  },
});

Barcode scanning example:

const result = await SmartScannerPlugin.executeScanner({
  action: 'START_SCANNER',
  options: {
    mode: 'barcode',
    barcodeOptions: {
      barcodeFormats: [
        'AZTEC',
        'CODABAR',
        'CODE_39',
        'CODE_93',
        'CODE_128',
        'DATA_MATRIX',
        'EAN_8',
        'EAN_13',
        'QR_CODE',
        'UPC_A',
        'UPC_E',
        'PDF_417',
      ],
    },
    config: {
      background: '#ffc234',
      label: 'Sample Label',
    },
  },
});

Refer to the API Reference for more information about the available API options and the returned result.

Related projects

License

Apache-2.0 License

smartscanner-capacitor's People

Contributors

arnellebalane avatar dependabot[bot] avatar nicholemnl avatar rjmangubat23 avatar spenceraee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

smartscanner-capacitor's Issues

Fix parsing of nameOfHolder for NFC scan

Current Behaviour

parsing of nameOfHolder is not returning properly

Expected Behaviour

Fix parsing of nameOfHolder to separate givenNames and surname depending on locale defined

Also Extract Passport Face Image and Signature in NFC Scanning

Current Behaviour

The only image that can be fetched in the NFC Scanning is the scanned photo of the passport. There is still no configuration to fetch the signature and Person's Photo

Expected Behaviour

An option to fetch the signature and face image of the passport owner. The photo can be fetched using by path or base64 string of the image.

Context

  • Version: --
  • Platform: Ionic Angular
  • Capacitor version: Support for 3 and up

The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.

Current Behaviour

Building an application with Capacitor v4 and React, when I try to create a simple test page I'm getting this error.

Full message:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
project ':idpass-smartscanner-capacitor' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10
Update plugins
Affected Modules: app

When clicking on "Update plugins" it goes to a refactor tab but doesn't actually do anything.

Expected Behaviour

A test application should compile and run allowing me to try out the basic functionality.

Steps to Reproduce the Problem

  1. Use Capacitor v4
  2. Build and sync your project
  3. Open in Android Studio and sync Gradle

Solution

Change buildscript.ext.kotlin_version to "1.5.20" in build.gradle

Context

Windows 11, Node LTS, Android Studio 2022.1.1 (Electric Eel), Gradle 7.4.1.

  • Version: 0.5.0-beta.9
  • Platform: Node
  • Capacitor version: 4.6.3

PDF417 crash in capacitor app

Current Behaviour

When opening PDF417 scanner it will crash immediately.

Expected Behaviour

It should scan with no problem

Steps to Reproduce the Problem

  1. Install app via npx cap run android
  2. Open application and SmartScanner that set mode to 'pdf417
  3. it will open scanner and freeze then crash

Note : installing via AndroidStudio does seems to work

Context

  • Version: 0.5.0
  • Platform: Android
  • Capacitor version: 4

build.gradle fails to resolve :libsmartscanner-debug and :libsmartscanner-mrz-parser

Current Behaviour

The build.gradle script is unable to resolve these required dependencies, preventing the Android Capacitor app from running successfully.

Expected Behaviour

App should successfully build and run on an Android emulator

Steps to Reproduce the Problem

  1. Create simple Capacitor project with SmartScanner boilerplate
  2. Use Capacitor to sync Android build
  3. In Android Studio, sync Gradle

Context

Windows 11, Node LTS, Android Studio 2022.1.1 (Electric Eel), JDK 11, Gradle 7.2.1 (Have also tried with 7.4.1 but no difference there)

  • Version: 0.5.0-beta.9
  • Platform: Android
  • Capacitor version: 4.6.3

Support for Capacitor v3 and up

Current Behaviour

Only supports Capacitor v2.

Expected Behaviour

Support for Capacitor v3 and up

Steps to Reproduce the Problem

  1. Use version 3 or 4 of capacitor
  2. Run npm i @idpass/smartscanner-capacitor
  3. Error will show that the package uses capacitor peer @capacitor/core@"^2.4.1" from @idpass/[email protected]

Context

Capacitor 3 info:
image

Capacitor 4 info (Latest):
image

Publish package to NPM

Expected Behaviour

Publish this package to the NPM registry so that they can be easily installed by users.

Scanning multiple times with Capacitor breaks the plugin

Current Behaviour

It will display a black screen instead of the camera, after scanning one time

Expected Behaviour

It should still work even after multiple times of scanning

Steps to Reproduce the Problem

  1. Use the plugin scan
  2. Get a result
  3. Scan again

Context

  • Version: 0.5.0-beta-9
  • Platform: Android
  • Capacitor version: v4

iOS: Missing function implementation

Current Behaviour

In the current version of the plugin, the implementation of function executeScanner is missing
image

Expected Behaviour

We need to implement the function to be also supported for iOS.

Steps to Reproduce the Problem

  1. Install the plugin into the capacitor project.
  2. Sync the plugin to the iOS platform.
  3. On executing the code you will receive the following error the function is UNIMPLEMENTED.
image

Context

While trying to use this plugin for the iOS platform I came across the error that the function is Unimplemented.

  • Version: 0.6.0
  • Platform: iOS
  • Capacitor version: 4.6.1

Are passport images/nfc data being stored?

I have tried the plugin for Android and I am curious on how it works. Does the plugin stores any data from the user? I see that it involves text extraction so probably you are using a backend that might store images or data of a passport.

bundleDebugAar build error

Current Behaviour

  • bundleDebugAar build error when assembleDebug is run on terminal

Expected Behaviour

  • Should have no error upon build on terminal

Context

Screenshot of error:
image

[`Task :app:processDebugMainManifest FAILED`] Cannot run latest version 0.5.0-beta.7

Current Behaviour

Failed running app with the latest version of the plugin.
Shows error:
image

Expected Behaviour

Should be able to run without errors.

Steps to Reproduce the Problem

  1. Create new application using ionic start appName blank
  2. Install plugin npm i @idpass/smartscanner-capacitor
  3. Add android: ionic cap android
  4. Sync: ionic cap sync
  5. Run: ionic cap run android
  6. Build will not proceed and an error will occur

Context


Ionic:

   Ionic CLI                     : 6.19.1 (C:\Users\dave.banguilan\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework               : @ionic/angular 6.4.1
   @angular-devkit/build-angular : 15.0.4
   @angular-devkit/schematics    : 15.0.4
   @angular/cli                  : 15.0.4
   @ionic/angular-toolkit        : 6.1.0

Capacitor:

   Capacitor CLI      : 4.6.1
   @capacitor/android : 4.6.1
   @capacitor/core    : 4.6.1
   @capacitor/ios     : 4.6.1

Utility:

   cordova-res : 0.15.4
   native-run  : 1.7.1

System:

   NodeJS : v16.14.0 (C:\Program Files\nodejs\node.exe)
   npm    : 8.3.1
   OS     : Windows 10

Attempting to scan NFC or barcode causes Android app to crash

Current Behaviour

React Capacitor app consistently crashes after attempting to scan NFC or barcodes using the examples provided. With NFC it just immediately crashes even if no tags are near and for barcode it crashes as soon as the camera detects a barcode.

Expected Behaviour

App should not crash and NFC tags/barcodes should be scanned.

Steps to Reproduce the Problem

  1. Create project with boilerplate code for NFC and barcode
  2. Build APK and install on Android device
  3. Attempt to scan items

Context

Samsung S9, Android 10, Android Studio 2022.1.1 (Electric Eel), Gradle 7.4.1

  • Version: 0.5.0-beta.9
  • Platform: Android
  • Capacitor version: 4.6.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.