Skip to content

Commit

Permalink
doc++
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Feb 12, 2018
1 parent 23395be commit a10faea
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [2.7.5](https://github.com/EddyVerbruggen/nativescript-barcodescanner/tree/2.7.5) (2018-02-12)
[Full Changelog](https://github.com/EddyVerbruggen/nativescript-barcodescanner/milestone/28?closed=1)


## [2.7.4](https://github.com/EddyVerbruggen/nativescript-barcodescanner/tree/2.7.4) (2017-12-15)
[Full Changelog](https://github.com/EddyVerbruggen/nativescript-barcodescanner/milestone/27?closed=1)

Expand Down
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,51 @@ From the command prompt go to your app's root folder and execute:
tns plugin add nativescript-barcodescanner
```

## Embedding the scanner on an existing page (iOS)

<img src="docs/ios_embedded_scanner.png" width="281px"/>

As you can see, you can style the view any way you like, and even overlay it with an image or button.
To recreate the layout above, look at [these lines in the demo app](https://github.com/EddyVerbruggen/nativescript-barcodescanner/blob/23395bec3e5a26622146daea96dd6407a8413f70/demo/app/main-page.xml#L17-L31).

### XML
```xml
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:Barcode="nativescript-barcodescanner">
```

```xml
<iOS>
<Barcode:BarcodeScannerView
class="scanner-round"
formats="QR_CODE, EAN_13"
beepOnScan="true"
reportDuplicates="true"
preferFrontCamera="false"
scanResult="onScanResult" />
</iOS>
```

### Embedding in Angular
Component:

```typescript
import { registerElement } from "nativescript-angular/element-registry";
registerElement("BarcodeScanner", () => require("nativescript-barcodescanner").BarcodeScannerView);
```

View:

```html
<BarcodeScanner
class="scanner-round"
formats="QR_CODE, EAN_13"
beepOnScan="true"
reportDuplicates="true"
preferFrontCamera="false"
(scanResult)="onScanResult($event)" />
</BarcodeScanner>
```

## iOS runtime permission reason
You've probably seen a permission popup like this before (this plugin will trigger one as well, automatically):

Expand Down
Binary file added docs/ios_embedded_scanner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-barcodescanner",
"version": "2.7.4",
"version": "2.7.5",
"description": "Scan QR/barcodes with your NativeScript app.",
"main": "barcodescanner",
"typings": "index.d.ts",
Expand Down

0 comments on commit a10faea

Please sign in to comment.