GithubHelp home page GithubHelp logo

flipace / capacitor-codescanner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rdlabo-team/capacitor-codescanner

0.0 1.0 0.0 122 KB

Capacitor Plugin for Code Scanner

Ruby 5.71% Java 10.56% Objective-C 4.10% Swift 69.20% JavaScript 1.62% TypeScript 8.80%

capacitor-codescanner's Introduction

@rdlabo/capacitor-codescanner

Capacitor CodeScanner is a native AdMob implementation for iOS. Now, This work at iOS only.

CodeType Web iOS Android
aztec - -
code128 - -
code39 - -
code39Mod43 - -
dataMatrix - -
ean13 - -
ean8 - -
face - -
interleaved2of5 - -
itf14 - -
pdf417 - -
qr - -
upce - -
catBody - -
dogBody - -
humanBody - -
salientObject - -

iOS ScreenShot

DONATE THIS PROJECT

Thanks for considering donate.

If this plugin help you, please share admob income. This help developing this plugin.This also help me easily determine how much time I would spend on the projects each month.

TYPE AMOUNT LINK
PayPal.me Once Any Donate
Paypal Subscription $15/month Donate
Paypal Subscription $30/month Donate
Paypal Subscription $50/month Donate

Installation

$ npm install --save @rdlabo/capacitor-codescanner

How To Use

import { Plugins } from '@capacitor/core';
const { CodeScanner } = Plugins;
import { ScannerOption } from '@rdlabo/capacitor-codescanner';

@Component({
  selector: 'app-root',
  templateUrl: 'app.component.html',
  styleUrls: ['app.component.scss']
})
export class AppComponent implements OnInit {
    constructor(){
        CodeScanner.addListener('CodeScannerCatchEvent', async (info: { code: string }) => {
            console.log(info.code); // Get Code
        });
    }

    openCodeScanner(){
        const option: ScannerOption = {
          detectionX: 0.2,
          detectionY: 0.35,
          detectionWidth: 0.6,
          detectionHeight: 0.15,
        };
        CodeScanner.present(option);
    }
}

APIs

present(): Promise<{ value: boolean }>

CodeScanner.present(ScannerOption);

Event Listener

addListener(eventName: 'CodeScannerCatchEvent', listenerFunc: (info: any) => void): PluginListenerHandle;

Options

ScannerOption

interface AdOptions {
  detectionX?: number;
  detectionY?: number;
  detectionWidth?: number;
  detectionHeight?: number;
  metadataObjectTypes?: Record<
    'aztec' | 'code128' | 'code39' | 'code39Mod43' | 'code93' | 'dataMatrix'
    | 'ean13' | 'ean8' | 'face' | 'interleaved2of5' | 'itf14' | 'pdf417'
    | 'qr' | 'upce' | 'catBody' | 'dogBody' | 'humanBody' | 'salientObject'
    , []>
}

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.