https://github.com/bitjson/qrscanner-test
Simple test project for cordova-plugin-qrscanner
https://github.com/bitjson/qrscanner-test
Last synced: 12 months ago
JSON representation
Simple test project for cordova-plugin-qrscanner
- Host: GitHub
- URL: https://github.com/bitjson/qrscanner-test
- Owner: bitjson
- Created: 2016-10-05T15:15:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-06T00:48:24.000Z (over 9 years ago)
- Last Synced: 2025-01-14T06:47:11.684Z (about 1 year ago)
- Language: CSS
- Size: 26.4 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# qrscanner-test
This is a test project for `cordova-plugin-qrscanner`. It can be used to confirm that the plugin can be built on your development environment.
## Install
Be sure you've followed the Cordova project's instructions for setting up your development environment, then run:
```bash
git clone https://github.com/bitjson/qrscanner-test
cd qrscanner-test
cordova prepare
```
## Run
### Android
```bash
adb devices
# (get the device id from the output)
cordova run android --target= #(device id goes here)
```
### iOS
```bash
cordova run ios
```
### Browser
```bash
cordova run browser
```
## What it should do
When the app loads, the scanner should already be showing, and the first scan should be active. If a QR code is scanned, scanning will stop, and an alert will display the contents. (The video preview will remain active.) Completely close and reload the app to start scanning again.
## How this repo was created
```bash
cordova create qrscanner-test
cd qrscanner-test
cordova platform add android ios browser --save
cordova plugin add cordova-plugin-qrscanner --save
vi www/index.html
# add the following attribute to the body element
# style="background: none transparent;"
vi www/js/index.js
# add the following at the bottom of the receivedEvent function:
# window.QRScanner.scan(function(err, contents){
# err && console.err(err);
# window.alert(contents);
# });
# window.QRScanner.show();
printf 'hooks\nplatforms\nplugins' > .gitignore
```
Now it's possible to follow the instructions from the [Run section](#Run).