1.0.4 • Published 7 years ago

quander-scanner v1.0.4

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

#Installation npm install quander-scanner

Usage

The scanner comes in two parts. One is an iOS app that uses our Quander ID scanner to scan, decrypt/decode a QR code.

The second is a JavaScript client that runs in your web app to receive an attendee object which contains everything you need to submit that attendee via the Quander SDK.

The JavaScript client can be used to control the QR Scanner.

The QR Scanner presents itself behind your webpage, this allows you to skin it the way that you like by adding UI in your web application.

To see the scanner, you must set your body background to be transparent.

iOS App

  • Download and install the Quander Scanner for iOS, you can request a download link from your Quander Account manager.
  • Set the Web App URL setting in the settings for the iOS app to your entry page

Web App

  • Require 'quander-scanner' in your file

var QuanderScanner = require('quander-scanner').QuanderScanner

  • Create a new instance of the scanner

var scanner = new QuanderScanner()

  • Listen for the ready event
scanner.on('ready', function(error) {
    alert('Ready!');
}});
  • Once ready, you can start using the scanner

How to Start The Scanner

Once the scanner is ready, you can start it. If the scanner is not ready, it will throw an error

try {
    scanner.start();
} catch (error){
    // Handle your error!
}

Receiving a New Attendee

When a valid Quander ID has been scanned, a new-attendee event is emitted.

scanner.on('new-attendee', function(attendee){
    alert('New Attendee!');
});

The Attendee Object

On a successful scan, you will receive an attendee object. The attendee object will contain the attendee's name, code and type if the attendee has registered through the event companion.

Registered Attendee

{
    firstname: 'Firstname',
    lastname: 'Lastname',
    code: '123e4567-e89b-12d3-a456-426655440000',
    type: 'attendeeUUID'
}

Un-Registered Attendee

{
    firstname: '',
    lastname: '',
    code: 'QNDR12345',
    type: 'referenceID'
}

Note that the firstname and lastname properties are blank.

Pausing and Resuming the Scanner

It is recommended that you pause the scanner whilst you're processing the data and resume it if you need to scan another code.

scanner.on('new-attendee', function(attendee){
    scanner.pause();
    alert('New Attendee!');
    scanner.resume();
});

Stopping the Scanner

To save battery, you should stop the scanner when you no longer need it and unsubscribe from the new-attendee event.

scanner.off('new-attendee');
scanner.stop();

If you are using React.js, this should be done in componentWillUnmount.

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago