npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

com.os.mobile.blinkreceipt

v0.0.6

Published

Plugin to scan receipts using BlinkReceipt SDK

Downloads

3

Readme

blinkreceipt-cordova

This is a Cordova plugin that wraps the BlinkReceipt iOS and (coming soon) Android SDKs

Installation

  1. Clone or download this repository
  2. In your Cordova app's folder run cordova plugin add /path/to/blinkreceipt-cordova
  • Note: This will automatically download the BlinkReceipt iOS static framework which is ~20mb so it may take a few minutes depending on your connection speed

Usage

  • To initiate a scan session, you call the scanReceipt function as follows:
cordova.plugins.blinkReceipt.scanReceipt(successCallback, errorCallback, options);
  • The options parameter you pass in is an object with the following properties:

Property | Required | Description -------- | -------- | ------------- licenseKey | Yes | This is the iOS license key that you must generate at the Microblink Dashboard staticScan | No | By default the scanning session will use the live camera, but you can pass true for this parameter to instead scan from the camera roll. When running on the iOS simulator you will always scan from camera roll. edgeDetection | No | Pass true in order to turn on edge detection which prompts the user with tips for adjusting their distance from the receipt storeUserFrames | No | Pass true in order to store the frames the user snapped during the scan session. The file paths for these frames will be found in the userFramesFilepaths key of the scan results dontSaveData | No | Pass true to prevent the SDK from saving any receipt data or images remotely invoiceMode | No | Pass true to indicate that the document type for this scan session is a full size paper invoice (rather than a receipt)

  • The successCallback is a function as follows:
function successCallback(scanResults) {
  //access results
}
  • scanResults is an object containing all the data from the scan session with property names matching those of the iOS results objects such as BRScanResults, BRProduct etc which are all documented at https://blinkreceipt.github.io/blinkreceipt-ios

  • The errorCallback is a function as follows:

function errorCallback(errorObject) {
  //errorObject.error contains a description of the error
}
  • As with all Cordova plugins, you must wait for the deviceready event before interacting with this plugin.

Example

  • Here is a small demo showing how to initate a scan session and output the results to the console from within your own Cordova app (this assumes your page has a button with id btnScan on it):
var app = {

    // Application Constructor
    initialize: function() {
        document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
    },

    // deviceready Event Handler
    //
    // Bind any cordova events here. Common events are:
    // 'pause', 'resume', etc.
    onDeviceReady: function() {
        document.getElementById('btnScan').addEventListener('touchstart', this.btnScanTouch.bind(this));
    },

    btnScanTouch: function() {
        var options = {licenseKey: "your_license_key",
                        edgeDetection: true,
                        storeUserFrames: true
                        };

        cordova.plugins.blinkReceipt.scanReceipt(this.scanSuccess.bind(this), this.scanFailure.bind(this), options);
    },

    scanSuccess: function(scanResults) {
        window.alert("Scanning complete!");
        
        console.log("Scan results: " + JSON.stringify(scanResults));
    },

    scanFailure: function(error) {
        window.alert("Scanning error: " + error.error);
    },
};

app.initialize();