Skip to content
Capacitor Plugin for Code Scanner
Swift Java TypeScript Ruby Objective-C JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
android change() remove 'Plugin' from class name Jan 14, 2020
ios fix(): remove enable metadataOutput.availableMetadataObjectTypes Jan 17, 2020
screenshot update(readme): add screenshot Jan 17, 2020
src feat(): 読み込みコードのタイプを選択できるように変更 Jan 17, 2020
.gitignore first commit Jan 14, 2020
.npmignore first commit Jan 14, 2020
README.md feat(): 読み込みコードのタイプを選択できるように変更 Jan 17, 2020
RdlaboCapacitorCodescanner.podspec first commit Jan 14, 2020
package-lock.json first commit Jan 14, 2020
package.json release 0.1.2 Jan 17, 2020
rollup.config.js first commit Jan 14, 2020
tsconfig.json first commit Jan 14, 2020

README.md

@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'
    , []>
}
You can’t perform that action at this time.