barkoder-nativescript 1.5.1 → 1.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -0
- package/barkoder-nativescript.android.ts +65 -0
- package/barkoder-nativescript.common.ts +55 -0
- package/barkoder-nativescript.ios.ts +68 -0
- package/package.json +1 -1
- package/platforms/android/barkoder.aar +0 -0
- package/platforms/android/barkoder_nativescript.aar +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/Barkoder +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/Headers/iBarkoder.h +2 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/Barkoder +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/Headers/iBarkoder.h +2 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/_CodeSignature/CodeResources +10 -10
- package/platforms/ios/BarkoderSDK.xcframework/Info.plist +5 -5
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/BarkoderSDK +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Headers/BarkoderSDK-Swift.h +12 -1
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Info.plist +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios.abi.json +699 -3749
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +19 -18
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios.swiftinterface +19 -18
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/templates.json +14 -3
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/BarkoderSDK +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Headers/BarkoderSDK-Swift.h +24 -2
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Info.plist +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +699 -3749
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +19 -18
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +19 -18
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +699 -3749
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +19 -18
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +19 -18
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/_CodeSignature/CodeResources +25 -25
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/templates.json +14 -3
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_384x256.mlmodelc/analytics/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_384x256.mlmodelc/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_384x256.mlmodelc/metadata.json +0 -85
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_384x256.mlmodelc/model.mil +0 -753
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_384x256.mlmodelc/weights/weight.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_512x384.mlmodelc/analytics/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_512x384.mlmodelc/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_512x384.mlmodelc/metadata.json +0 -85
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_512x384.mlmodelc/model.mil +0 -753
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_512x384.mlmodelc/weights/weight.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/mrz.traineddata +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/mrzfast.traineddata +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_384x256.mlmodelc/analytics/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_384x256.mlmodelc/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_384x256.mlmodelc/metadata.json +0 -85
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_384x256.mlmodelc/model.mil +0 -753
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_384x256.mlmodelc/weights/weight.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_512x384.mlmodelc/analytics/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_512x384.mlmodelc/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_512x384.mlmodelc/metadata.json +0 -85
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_512x384.mlmodelc/model.mil +0 -753
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_512x384.mlmodelc/weights/weight.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/mrz.traineddata +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/mrzfast.traineddata +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# barKoder Barcode Scanner SDK for mobile Nativescript Apps
|
|
2
|
+
## Ultimate software-based barcode scanning solution for Nativescript
|
|
3
|
+
|
|
4
|
+
The [barKoder Barcode Scanner SDK](https://barkoder.com/barcode-scanner-sdk) Nativescript plugin grants an easy to use Nativescript solution with a great and option-rich interface that can be integrated in both iOS and Android apps. Integrating the barKoder Barcode Scanner SDK into your Enterprise or Consumer-facing mobile apps will instantly transform your user's smartphones and tablets into rugged barcode scanning devices without the need to procure and maintain expensive and sluggish hardware devices that have a very short life span.
|
|
5
|
+
|
|
6
|
+
Even though the barKoder barcode scanner SDK is a relatively new product, it is already more advanced than any competitor API's. Its robust barcode reading engine can be used to read the content of the most widely used barcodes with lightning fast speed and unprecedented recognition rate:
|
|
7
|
+
|
|
8
|
+
1D - [Codabar](https://barkoder.com/barcode-types/codaba), [Code 11](https://barkoder.com/barcode-types/code-11), [Code 25](https://barkoder.com/barcode-types/code-25), [Code 39](https://barkoder.com/barcode-types/code-39), [Code 93](https://barkoder.com/barcode-types/code-93), [Code 128](https://barkoder.com/barcode-types/code-128), [DotCode](https://barkoder.com/barcode-types/dotcode), [EAN-8](https://barkoder.com/barcode-types/ean-upc-code), [EAN-13](https://barkoder.com/barcode-types/ean-upc-code), [Interleaved 2 of 5](https://barkoder.com/barcode-types/code-25), [ITF-14](https://barkoder.com/barcode-types/code-25), [MSI Plessey](https://barkoder.com/barcode-types/msi-plessey), [Pharmacode](https://barkoder.com/barcode-types/code-32), [Telepen](https://barkoder.com/barcode-types/telepen), [UPC-A](https://barkoder.com/barcode-types/ean-upc-code) & [UPC-E](https://barkoder.com/barcode-types/ean-upc-code)
|
|
9
|
+
2D - [Aztec Code](https://barkoder.com/barcode-types/aztec), [Aztec Compact](https://barkoder.com/barcode-types/aztec), [Data Matrix](https://barkoder.com/barcode-types/data-matrix), [DotCode](https://barkoder.com/barcode-types/dotcode),[PDF417](https://barkoder.com/barcode-types/pdf417), [Micro PDF417](https://barkoder.com/barcode-types/pdf417), [QR Code](https://barkoder.com/barcode-types/qr-code) & [Micro QR Code](https://barkoder.com/barcode-types/qr-code)
|
|
10
|
+
|
|
11
|
+
The [barKoder SDK](https://barkoder.com/) features multiple algorithms that handle a wide variety of barcode scanning scenarios with unprecedented performance in terms of speed and success rate:
|
|
12
|
+
* [DPM Mode](https://barkoder.com/dpm-barcode-scanner-sdk) - Specially designed scanning template for decoding Data Matrix barcodes engraved using any Direct Part Marking (DPM) technique;
|
|
13
|
+
* [MatrixSight](https://barkoder.com/matrixsight) - MatrixSight® is the ultimate 2D barcode recognition system. Its capabilities transcend beyond anything that a traditional barcode scanner, be that hardware or software-based, can achieve. Simply put, there's no QR Code or Data Matrix barcode that is safe from the barKoder MatrixSight® algorithm. They can have absolutely no finder, alignment or timing patters and can even miss entire data segments but that still won't keep their data safe from being read;
|
|
14
|
+
* [Segment Decoding](https://barkoder.com/segment-decoding) - The advanced barcode localization logics that are part of the Segment Decoding® technique elevated the barKoder SDK into the most powerful scanning API when it comes to 1D barcode recognition, regardless whether the barcodes have been deformed, crumpled, wrinkled and otherwise altered. Even if it goes to a degree where a straight line can't pass through all its bars, a limitation that other decoders, including hardware ones can't alleviate. Segment Decoding® is unmatched in its performance levels and pattern matching capabilities, amortizing even the highest degree of barcode damages, including printing errors, label damage, scanner angles, low print quality, as well as various other levels of physical damage or environmental conditionings. The fact that the data can be extracted even from 1D barcodes that have significant deformations along their Z axis, makes barKoder especially handy when trying to recognize barcodes found on test tubes, bottles and other surfaces with rounded, curved, hollowed or otherwise irregular shapes;
|
|
15
|
+
* [VIN Barcode Scanning Mode](https://barkoder.com/vin-scanning-mode) - When you combine MatrixSight® & Segment Decoding®, the result is breathtaking and leads to the most advanced VIN barcode scanner on the market, able to capture the data even within the most stubborn & difficult to read VIN-powered Code 39, Code 128, Data Matrix & QR Codes;
|
|
16
|
+
* [DeBlur Mode](https://barkoder.com/deblur-mode) - Whether there's lens, motion or focus blur present in EAN or UPC barcodes, the barKoder DeBlur Mode alleviates it fully and doesn't allow the scanning experience to suffer;
|
|
17
|
+
* [PDF417-LineSight](https://barkoder.com/pdf417-linesight) - The robust PDF417 barcode scanner SDK that is offered by barKoder can detect even the most severely damaged PDF417 codes, including samples missing their start and stop patterns, stop row indicators or even entire data columns, making it the sublime choice for apps that need to reliably scan US or Canadian driver's licenses, South African vehicle license discs or driver's licenses, as well as various types of ID's such as Military, Argentinian, Colombian or South African Smart ID Cards.
|
|
18
|
+
* [Batch MultiScan](https://barkoder.com/batch-multiscan) - The Batch MultiScan feature of the barKoder Barcode Scanner SDK for mobile apps and websites, will enable your users to decode multiple barcodes regardless of their type or size in one go. The barKoder API covers all common 1D and 2D barcode symbologies, enabling intuitive and fast data capture while delivering an accuracy of at least 99%, even under the most difficult scanning conditions. Whether in inventory counting, on the last mile or in manufacturing, our fast and accurate Batch MultiScan algorithm greatly increases efficiency and helps create friction-less internal and external processes. The Batch MultiScan works with smartphones, tablets and industrial cameras, enabling true mobility wherever it’s applied.
|
|
19
|
+
* [DPM Recognition Mode](https://barkoder.com/dpm-barcode-scanner-sdk) - barKoder SDK's unique algorithms and features provided all the necessary conditions for creating a special mode for decoding even the most challenging Data Matrix barcodes, i.e. those engraved utilizing the Direct Part Marking (DPM) methods, something that previously was only possible with extremely expensive and specialized hardware scanners. Now all you need to achieve such barcode reading levels is your own personal smart device!
|
|
20
|
+
|
|
21
|
+
You can check out our free demo app Barcode Scanner by barKoder available both via [Apple App Store](https://apps.apple.com/us/app/barkoder-scanner/id6443715409?uo=2) & [Google Play Store](https://play.google.com/store/apps/details?id=com.barkoder.demoscanner).
|
|
22
|
+
|
|
23
|
+
## Trial License
|
|
24
|
+
|
|
25
|
+
If you run the barKoder Barcode Scanner SDK without a valid trial or production license, all results upon successful barcode scans will be partially masked by asterisks (*). You can get a trial license simply by [registering on the barKoder Portal](https://barkoder.com/register) and utilizing the self-service for [Evaluation License Generation](https://barkoder.com/spr/new)! Each trial license will be good for an initial duration of 30 days and can be deployed to up to 25 devices. For any custom requirements, contact our sales team via sales@barkoder.com
|
|
26
|
+
|
|
27
|
+
Note that a trial license is only supposed to be utilized in a development or staging environment.
|
|
28
|
+
|
|
29
|
+
## Free Developer Support
|
|
30
|
+
|
|
31
|
+
Our support is completely free for integration or testing purposes and granted through the [barKoder Portal](https://barkoder.com/login). After registering and logging into your account, you only need to submit a [Support Issue](https://barkoder.com/issues) form. Alternatively, you can contact us by email via support@barkoder.com.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# Installation Guide for barKoder's Nativescript Barcode Reader SDK
|
|
35
|
+
|
|
36
|
+
This is a guide for the barKoder [NativeScript Plugin]
|
|
37
|
+
|
|
38
|
+
## 1. Prepare environment
|
|
39
|
+
Install the dependencies and [setup your environment](https://docs.nativescript.org/setup)
|
|
40
|
+
|
|
41
|
+
## 2. Add our barkoder-nativescript package
|
|
42
|
+
To add the **barkoder-nativescript** package to your project, you have two options. You can either use the **barkoder-nativescript** package from **npm** or from a local path.
|
|
43
|
+
|
|
44
|
+
To use the package from [npm](https://www.npmjs.com/package/barkoder-nativescript) run this command:
|
|
45
|
+
|
|
46
|
+
```c
|
|
47
|
+
npm i barkoder-nativescript
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
if you are using **NPM** in your project.
|
|
51
|
+
|
|
52
|
+
If you prefer to use a local package, download the package from [https://barkoder.com](https://barkoder.com/repository), unzip the archive and add the package with setting the package path
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
tns plugin add <path to barkoder-nativescript package>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## 3. Import package
|
|
59
|
+
Import the **Barkoder Constants** in your project with:
|
|
60
|
+
```typescript
|
|
61
|
+
import { BarkoderConstants } from 'barkoder-nativescript/barkoder-nativescript.common';
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 4. BarkoderView
|
|
65
|
+
At this point the **barkoder-nativescript** package is installed and imported in your project. Next step is to add the **BarkoderView** in your layout.
|
|
66
|
+
```xml
|
|
67
|
+
|
|
68
|
+
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo"
|
|
69
|
+
xmlns:Barkoder="barkoder-nativescript/barkoder-nativescript.common">
|
|
70
|
+
...
|
|
71
|
+
|
|
72
|
+
<Barkoder:BarkoderView id="barkoderView" class="scanner-container" width="100%" height="70%"/>
|
|
73
|
+
|
|
74
|
+
...
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 5. Init BarkoderView in ViewModel and set the License Key
|
|
79
|
+
Inside **View-Model** we need to init a BarkoderView from layout xml.
|
|
80
|
+
```typescript
|
|
81
|
+
export class HelloWorldModel extends Observable implements BarkoderConstants.BarkoderResultCallback {
|
|
82
|
+
private barkoderView : any
|
|
83
|
+
constructor(args) {
|
|
84
|
+
super()
|
|
85
|
+
|
|
86
|
+
this.barkoderView = args.object.page.getViewById('barkoderView');
|
|
87
|
+
this.barkoderView.setLicenseKey("License_Key")
|
|
88
|
+
|
|
89
|
+
}
|
|
90
|
+
scanningFinished(results: any[], thumbnails: any[], resultImage: any): void {
|
|
91
|
+
console.log(`${results[0].textualData}`)
|
|
92
|
+
console.log(`${results[0].barcodeTypeName}`)
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## 6. Ready to Scan Event
|
|
97
|
+
SDK is fully initialized and ready for configuration or to start the scanning process.
|
|
98
|
+
```typescript
|
|
99
|
+
|
|
100
|
+
this.barkoderView.startScanning(this)
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
For the complete usage of the **barkoder-nativescript** package please check our sample.
|
|
104
|
+
|
|
105
|
+
## 7. Camera permissions
|
|
106
|
+
Our SDK requires camera permission to be granted in order to use scanning features.On Android, you specify the permissions in App_Resources/Android/src/main/AndroidManifest.xml. However, this plugin specifies the required permissions for you. [@nativescript/camera](https://www.npmjs.com/package/@nativescript/camera)
|
|
107
|
+
. For iOS you need to specify camera permission in **Info.plist** file inside your project
|
|
108
|
+
```swift
|
|
109
|
+
<key>NSCameraUsageDescription</key>
|
|
110
|
+
<string>Camera permission</string>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## 8. Licensing
|
|
114
|
+
The SDK will scan barcodes even without a valid license; however all results will be randomly masked with (*) Asterisk characters. By using our software you are agreeing to our [End User License Agreement](https://barkoder.com/EULA). To obtain a valid license, one should create an account [here](https://barkoder.com/register) and either get a trial license (to test the software out) or procure a production license that can be used within a live app.
|
|
115
|
+
|
|
@@ -2,6 +2,9 @@ import { BarkoderConstants } from "./barkoder-nativescript.common";
|
|
|
2
2
|
import * as application from "@nativescript/core/application";
|
|
3
3
|
import { View } from "@nativescript/core";
|
|
4
4
|
import { BarkoderView } from "./barkoder-nativescript.common";
|
|
5
|
+
import { ImageSource } from '@nativescript/core';
|
|
6
|
+
|
|
7
|
+
|
|
5
8
|
|
|
6
9
|
const androidSupport =
|
|
7
10
|
global.androidx && global.androidx.appcompat
|
|
@@ -54,6 +57,35 @@ export class BarkoderViewAndroid extends View {
|
|
|
54
57
|
this.bkdView.startScanning(resultCallback);
|
|
55
58
|
}
|
|
56
59
|
|
|
60
|
+
|
|
61
|
+
scanImage(
|
|
62
|
+
base64Image: string,
|
|
63
|
+
BarkoderResultCallback: BarkoderConstants.BarkoderResultCallback
|
|
64
|
+
): void {
|
|
65
|
+
const BarkoderHelper = com.barkoder.BarkoderHelper;
|
|
66
|
+
|
|
67
|
+
// Convert base64 string to bitmap
|
|
68
|
+
const bitmap = ImageSource.fromBase64Sync(base64Image).android;
|
|
69
|
+
|
|
70
|
+
// Create an instance of BarkoderResultCallback
|
|
71
|
+
const resultCallback = new com.barkoder.interfaces.BarkoderResultCallback({
|
|
72
|
+
scanningFinished: (
|
|
73
|
+
results: any[],
|
|
74
|
+
thumbnails: any[],
|
|
75
|
+
resultImage: any
|
|
76
|
+
) => {
|
|
77
|
+
BarkoderResultCallback.scanningFinished(
|
|
78
|
+
results,
|
|
79
|
+
thumbnails,
|
|
80
|
+
resultImage
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// Pass the result callback correctly to scanImage
|
|
86
|
+
BarkoderHelper.scanImage(bitmap, this.bkdView.config, resultCallback, context);
|
|
87
|
+
}
|
|
88
|
+
|
|
57
89
|
/**
|
|
58
90
|
* Halts the barcode scanning process, stopping the camera from capturing and processing barcode information
|
|
59
91
|
*/
|
|
@@ -124,6 +156,19 @@ export class BarkoderViewAndroid extends View {
|
|
|
124
156
|
this.bkdView.config.setLocationLineColor(locationColor);
|
|
125
157
|
}
|
|
126
158
|
|
|
159
|
+
|
|
160
|
+
setIdDocumentMasterChecksumEnabled(enabled: boolean): void {
|
|
161
|
+
if(enabled){
|
|
162
|
+
this.bkdView.config.getDecoderConfig().IDDocument.masterChecksumType = com.barkoder.Barkoder.StandardChecksumType.Enabled
|
|
163
|
+
} else {
|
|
164
|
+
this.bkdView.config.getDecoderConfig().IDDocument.masterChecksumType = com.barkoder.Barkoder.StandardChecksumType.Disabled
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
isIdDocumentMasterChecksumEnabled(): boolean {
|
|
169
|
+
return this.bkdView.config.getDecoderConfig().IDDocument.masterChecksumType === com.barkoder.Barkoder.StandardChecksumType.Enabled;
|
|
170
|
+
}
|
|
171
|
+
|
|
127
172
|
/**
|
|
128
173
|
* Sets the color of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed
|
|
129
174
|
*/
|
|
@@ -991,6 +1036,26 @@ export class BarkoderViewAndroid extends View {
|
|
|
991
1036
|
this.bkdView.config.getDecoderConfig().Datamatrix.dpmMode = dpmModeEnabled;
|
|
992
1037
|
}
|
|
993
1038
|
|
|
1039
|
+
setQRDpmModeEnabled(dpmModeEnabled: boolean): void {
|
|
1040
|
+
this.bkdView.config.getDecoderConfig().QR.dpmMode = dpmModeEnabled;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
setQRMicroDpmModeEnabled(dpmModeEnabled: boolean): void {
|
|
1044
|
+
this.bkdView.config.getDecoderConfig().QRMicro.dpmMode = dpmModeEnabled;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
isDatamatrixDpmModeEnabled(): any {
|
|
1048
|
+
return this.bkdView.config.getDecoderConfig().Datamatrix.dpmMode;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
isQRDpmModeEnabled() : any {
|
|
1052
|
+
return this.bkdView.config.getDecoderConfig().QR.dpmMode
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
isQRMicroDpmModeEnabled() : any {
|
|
1056
|
+
return this.bkdView.config.getDecoderConfig().QRMicro.dpmMode
|
|
1057
|
+
}
|
|
1058
|
+
|
|
994
1059
|
/**
|
|
995
1060
|
* Sets whether the deblurring feature for UPC/EAN barcodes is enabled
|
|
996
1061
|
*/
|
|
@@ -376,6 +376,61 @@ export class DatamatrixBarcodeConfig {
|
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
+
|
|
380
|
+
export class QRBarcodeConfig {
|
|
381
|
+
enabled?: boolean;
|
|
382
|
+
dpmMode?: number;
|
|
383
|
+
private minLength?: number;
|
|
384
|
+
private maxLength?: number;
|
|
385
|
+
|
|
386
|
+
constructor(config: Partial<QRBarcodeConfig>) {
|
|
387
|
+
Object.assign(this, config);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
toMap() {
|
|
391
|
+
let map: { [key: string]: any } = {
|
|
392
|
+
"enabled": this.enabled,
|
|
393
|
+
"dpmMode": this.dpmMode,
|
|
394
|
+
"minimumLength": this.minLength,
|
|
395
|
+
"maximumLength": this.maxLength,
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
return map;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
setLengthRange(minLength: number, maxLength: number) {
|
|
402
|
+
this.minLength = minLength;
|
|
403
|
+
this.maxLength = maxLength;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export class QRMicroBarcodeConfig {
|
|
408
|
+
enabled?: boolean;
|
|
409
|
+
dpmMode?: number;
|
|
410
|
+
private minLength?: number;
|
|
411
|
+
private maxLength?: number;
|
|
412
|
+
|
|
413
|
+
constructor(config: Partial<QRMicroBarcodeConfig>) {
|
|
414
|
+
Object.assign(this, config);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
toMap() {
|
|
418
|
+
let map: { [key: string]: any } = {
|
|
419
|
+
"enabled": this.enabled,
|
|
420
|
+
"dpmMode": this.dpmMode,
|
|
421
|
+
"minimumLength": this.minLength,
|
|
422
|
+
"maximumLength": this.maxLength,
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
return map;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
setLengthRange(minLength: number, maxLength: number) {
|
|
429
|
+
this.minLength = minLength;
|
|
430
|
+
this.maxLength = maxLength;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
379
434
|
export class GeneralSettings {
|
|
380
435
|
threadsLimit?: number;
|
|
381
436
|
decodingSpeed?: DecodingSpeed;
|
|
@@ -22,6 +22,34 @@ export class BarkoderViewIOS extends View {
|
|
|
22
22
|
this.bkdView.startScanningError(resultDelegate);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
scanImage(base64Image: string, callback: BarkoderConstants.BarkoderResultCallback): void {
|
|
26
|
+
|
|
27
|
+
// Convert Base64 to UIImage
|
|
28
|
+
const uiImage = this.convertBase64ToUIImage(base64Image);
|
|
29
|
+
const resultDelegate = new BarkoderViewWraper(callback);
|
|
30
|
+
ios.delegate = resultDelegate;
|
|
31
|
+
BarkoderHelper.scanImageBkdConfigResultDelegate(uiImage,this.bkdView.config, resultDelegate)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
convertBase64ToUIImage(base64String: string): UIImage | null {
|
|
35
|
+
if (!base64String) {
|
|
36
|
+
console.warn('Invalid Base64 string provided');
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Decode the Base64 string to NSData
|
|
41
|
+
const imageData = NSData.alloc().initWithBase64EncodedStringOptions(base64String, 0); // Using 0 as the option
|
|
42
|
+
|
|
43
|
+
if (!imageData) {
|
|
44
|
+
console.warn('Failed to decode Base64 string to NSData');
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Create a UIImage from NSData
|
|
49
|
+
const uiImage = UIImage.imageWithData(imageData);
|
|
50
|
+
return uiImage;
|
|
51
|
+
}
|
|
52
|
+
|
|
25
53
|
/**
|
|
26
54
|
* Halts the barcode scanning process, stopping the camera from capturing and processing barcode information
|
|
27
55
|
*/
|
|
@@ -158,6 +186,18 @@ export class BarkoderViewIOS extends View {
|
|
|
158
186
|
this.bkdView.config.regionOfInterestVisible = enabled;
|
|
159
187
|
}
|
|
160
188
|
|
|
189
|
+
setIdDocumentMasterChecksumEnabled(enabled: boolean): void {
|
|
190
|
+
if (enabled) {
|
|
191
|
+
this.bkdView.config.decoderConfig.idDocument.masterChecksum = 1
|
|
192
|
+
} else {
|
|
193
|
+
this.bkdView.config.decoderConfig.idDocument.masterChecksum = 0
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
isIdDocumentMasterChecksumEnabled(): boolean {
|
|
198
|
+
return this.bkdView.config.decoderConfig.idDocument.masterChecksum === 1
|
|
199
|
+
}
|
|
200
|
+
|
|
161
201
|
/**
|
|
162
202
|
* Defines the Region of Interest (ROI) on the camera preview for barcode scanning, specifying an area where the application focuses on detecting barcodes
|
|
163
203
|
*/
|
|
@@ -983,6 +1023,34 @@ export class BarkoderViewIOS extends View {
|
|
|
983
1023
|
}
|
|
984
1024
|
}
|
|
985
1025
|
|
|
1026
|
+
setQRDpmModeEnabled(dpmModeEnabled: boolean): void {
|
|
1027
|
+
if (dpmModeEnabled) {
|
|
1028
|
+
this.bkdView.config.decoderConfig.qr.dpmMode = 1;
|
|
1029
|
+
} else if (dpmModeEnabled == false) {
|
|
1030
|
+
this.bkdView.config.decoderConfig.qr.dpmMode = 0;
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
setQRMicroDpmModeEnabled(dpmModeEnabled: boolean): void {
|
|
1035
|
+
if (dpmModeEnabled) {
|
|
1036
|
+
this.bkdView.config.decoderConfig.qrMicro.dpmMode = 1;
|
|
1037
|
+
} else if (dpmModeEnabled == false) {
|
|
1038
|
+
this.bkdView.config.decoderConfig.qrMicro.dpmMode = 0;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
isDatamatrixDpmModeEnabled(): any {
|
|
1043
|
+
return this.bkdView.config.decoderConfig.datamatrix.dpmMode;
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
isQRDpmModeEnabled(): any {
|
|
1047
|
+
return this.bkdView.config.decoderConfig.qr.dpmMode
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
isQRMicroDpmModeEnabled(): any {
|
|
1051
|
+
return this.bkdView.config.decoderConfig.qrMicro.dpmMode
|
|
1052
|
+
}
|
|
1053
|
+
|
|
986
1054
|
/**
|
|
987
1055
|
* Retrieves the delay in milliseconds for considering duplicate barcodes during scanning
|
|
988
1056
|
*/
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -266,6 +266,7 @@ typedef enum {
|
|
|
266
266
|
//==========================================================================
|
|
267
267
|
@interface QRConfig : SpecificConfig
|
|
268
268
|
@property (nonatomic, readwrite) bool multiPartMerge;
|
|
269
|
+
@property (nonatomic, readwrite) int dpmMode;
|
|
269
270
|
- (id)initWithDecoderType:(DecoderType)decoderType;
|
|
270
271
|
@end
|
|
271
272
|
|
|
@@ -273,6 +274,7 @@ typedef enum {
|
|
|
273
274
|
// QRMicro Config
|
|
274
275
|
//==========================================================================
|
|
275
276
|
@interface QRMicroConfig : SpecificConfig
|
|
277
|
+
@property (nonatomic, readwrite) int dpmMode;
|
|
276
278
|
- (id)initWithDecoderType:(DecoderType)decoderType;
|
|
277
279
|
@end
|
|
278
280
|
|
package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/Barkoder
CHANGED
|
Binary file
|
|
@@ -266,6 +266,7 @@ typedef enum {
|
|
|
266
266
|
//==========================================================================
|
|
267
267
|
@interface QRConfig : SpecificConfig
|
|
268
268
|
@property (nonatomic, readwrite) bool multiPartMerge;
|
|
269
|
+
@property (nonatomic, readwrite) int dpmMode;
|
|
269
270
|
- (id)initWithDecoderType:(DecoderType)decoderType;
|
|
270
271
|
@end
|
|
271
272
|
|
|
@@ -273,6 +274,7 @@ typedef enum {
|
|
|
273
274
|
// QRMicro Config
|
|
274
275
|
//==========================================================================
|
|
275
276
|
@interface QRMicroConfig : SpecificConfig
|
|
277
|
+
@property (nonatomic, readwrite) int dpmMode;
|
|
276
278
|
- (id)initWithDecoderType:(DecoderType)decoderType;
|
|
277
279
|
@end
|
|
278
280
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
</data>
|
|
11
11
|
<key>Headers/iBarkoder.h</key>
|
|
12
12
|
<data>
|
|
13
|
-
|
|
13
|
+
jszfXt4mmOmsq71vgpaWY4wwVqM=
|
|
14
14
|
</data>
|
|
15
15
|
<key>Info.plist</key>
|
|
16
16
|
<data>
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
</data>
|
|
31
31
|
<key>float16_384x256.mlmodelc/coremldata.bin</key>
|
|
32
32
|
<data>
|
|
33
|
-
|
|
33
|
+
jSHmcR0CnfwpJFEcTE6Jq78OKEg=
|
|
34
34
|
</data>
|
|
35
35
|
<key>float16_384x256.mlmodelc/metadata.json</key>
|
|
36
36
|
<data>
|
|
37
|
-
|
|
37
|
+
LMdRtC1wCMUbS5K+oC3TUg0T9m0=
|
|
38
38
|
</data>
|
|
39
39
|
<key>float16_384x256.mlmodelc/model.mil</key>
|
|
40
40
|
<data>
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
</data>
|
|
51
51
|
<key>float16_512x384.mlmodelc/coremldata.bin</key>
|
|
52
52
|
<data>
|
|
53
|
-
|
|
53
|
+
5QXIh2aO0eeCXPXNOvQkOVkM//4=
|
|
54
54
|
</data>
|
|
55
55
|
<key>float16_512x384.mlmodelc/metadata.json</key>
|
|
56
56
|
<data>
|
|
57
|
-
|
|
57
|
+
DYFPvv1/hWFfhDu+DP4tZe1SadY=
|
|
58
58
|
</data>
|
|
59
59
|
<key>float16_512x384.mlmodelc/model.mil</key>
|
|
60
60
|
<data>
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
<dict>
|
|
87
87
|
<key>hash2</key>
|
|
88
88
|
<data>
|
|
89
|
-
|
|
89
|
+
AP6lUrKs1YTqkHsINX/J86Mk8hshfK3GauwNsYIS7tw=
|
|
90
90
|
</data>
|
|
91
91
|
</dict>
|
|
92
92
|
<key>Modules/module.modulemap</key>
|
|
@@ -114,14 +114,14 @@
|
|
|
114
114
|
<dict>
|
|
115
115
|
<key>hash2</key>
|
|
116
116
|
<data>
|
|
117
|
-
|
|
117
|
+
wVmELDvW9NuA+D4Lw+ofVNAEYvMmZdDMauCC+dorUfY=
|
|
118
118
|
</data>
|
|
119
119
|
</dict>
|
|
120
120
|
<key>float16_384x256.mlmodelc/metadata.json</key>
|
|
121
121
|
<dict>
|
|
122
122
|
<key>hash2</key>
|
|
123
123
|
<data>
|
|
124
|
-
|
|
124
|
+
ZM7I2LIWs3sKAtkTZxdoEKsgVoDgv9vhGMAV81jNiqk=
|
|
125
125
|
</data>
|
|
126
126
|
</dict>
|
|
127
127
|
<key>float16_384x256.mlmodelc/model.mil</key>
|
|
@@ -149,14 +149,14 @@
|
|
|
149
149
|
<dict>
|
|
150
150
|
<key>hash2</key>
|
|
151
151
|
<data>
|
|
152
|
-
|
|
152
|
+
j5sPbI531Z6F9Pcr3tBgYhDQGvv8un4+jvm5qmO1hNQ=
|
|
153
153
|
</data>
|
|
154
154
|
</dict>
|
|
155
155
|
<key>float16_512x384.mlmodelc/metadata.json</key>
|
|
156
156
|
<dict>
|
|
157
157
|
<key>hash2</key>
|
|
158
158
|
<data>
|
|
159
|
-
|
|
159
|
+
bStcTX2JtWXmGXxtzS1IdxRV75opXLtQ0MULA+XkbaM=
|
|
160
160
|
</data>
|
|
161
161
|
</dict>
|
|
162
162
|
<key>float16_512x384.mlmodelc/model.mil</key>
|
|
@@ -8,32 +8,32 @@
|
|
|
8
8
|
<key>BinaryPath</key>
|
|
9
9
|
<string>BarkoderSDK.framework/BarkoderSDK</string>
|
|
10
10
|
<key>LibraryIdentifier</key>
|
|
11
|
-
<string>ios-
|
|
11
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
12
12
|
<key>LibraryPath</key>
|
|
13
13
|
<string>BarkoderSDK.framework</string>
|
|
14
14
|
<key>SupportedArchitectures</key>
|
|
15
15
|
<array>
|
|
16
16
|
<string>arm64</string>
|
|
17
|
+
<string>x86_64</string>
|
|
17
18
|
</array>
|
|
18
19
|
<key>SupportedPlatform</key>
|
|
19
20
|
<string>ios</string>
|
|
21
|
+
<key>SupportedPlatformVariant</key>
|
|
22
|
+
<string>simulator</string>
|
|
20
23
|
</dict>
|
|
21
24
|
<dict>
|
|
22
25
|
<key>BinaryPath</key>
|
|
23
26
|
<string>BarkoderSDK.framework/BarkoderSDK</string>
|
|
24
27
|
<key>LibraryIdentifier</key>
|
|
25
|
-
<string>ios-
|
|
28
|
+
<string>ios-arm64</string>
|
|
26
29
|
<key>LibraryPath</key>
|
|
27
30
|
<string>BarkoderSDK.framework</string>
|
|
28
31
|
<key>SupportedArchitectures</key>
|
|
29
32
|
<array>
|
|
30
33
|
<string>arm64</string>
|
|
31
|
-
<string>x86_64</string>
|
|
32
34
|
</array>
|
|
33
35
|
<key>SupportedPlatform</key>
|
|
34
36
|
<string>ios</string>
|
|
35
|
-
<key>SupportedPlatformVariant</key>
|
|
36
|
-
<string>simulator</string>
|
|
37
37
|
</dict>
|
|
38
38
|
</array>
|
|
39
39
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#if 0
|
|
2
2
|
#elif defined(__arm64__) && __arm64__
|
|
3
|
-
// Generated by Apple Swift version
|
|
3
|
+
// Generated by Apple Swift version 6.0.2 effective-5.10 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)
|
|
4
4
|
#ifndef BARKODERSDK_SWIFT_H
|
|
5
5
|
#define BARKODERSDK_SWIFT_H
|
|
6
6
|
#pragma clang diagnostic push
|
|
@@ -42,6 +42,8 @@
|
|
|
42
42
|
#include <string.h>
|
|
43
43
|
#endif
|
|
44
44
|
#if defined(__cplusplus)
|
|
45
|
+
#pragma clang diagnostic push
|
|
46
|
+
#pragma clang diagnostic ignored "-Wnon-modular-include-in-framework-module"
|
|
45
47
|
#if defined(__arm64e__) && __has_include(<ptrauth.h>)
|
|
46
48
|
# include <ptrauth.h>
|
|
47
49
|
#else
|
|
@@ -55,6 +57,7 @@
|
|
|
55
57
|
# endif
|
|
56
58
|
#pragma clang diagnostic pop
|
|
57
59
|
#endif
|
|
60
|
+
#pragma clang diagnostic pop
|
|
58
61
|
#endif
|
|
59
62
|
|
|
60
63
|
#if !defined(SWIFT_TYPEDEFS)
|
|
@@ -294,6 +297,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
294
297
|
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
|
295
298
|
#pragma clang diagnostic ignored "-Wnullability"
|
|
296
299
|
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
|
|
300
|
+
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
|
|
297
301
|
|
|
298
302
|
#if __has_attribute(external_source_symbol)
|
|
299
303
|
# pragma push_macro("any")
|
|
@@ -414,6 +418,12 @@ SWIFT_CLASS("_TtC11BarkoderSDK14BarkoderHelper")
|
|
|
414
418
|
/// \param resultDelegate where you will receive scanned result
|
|
415
419
|
///
|
|
416
420
|
+ (void)scanImage:(UIImage * _Nonnull)image bkdConfig:(BarkoderConfig * _Nonnull)bkdConfig resultDelegate:(id <BarkoderResultDelegate> _Nonnull)resultDelegate;
|
|
421
|
+
/// Opens the device’s photo gallery, allowing you to choose an image to be processed for barcode scanning.
|
|
422
|
+
/// \param bkdConfig config that will be used for scanning process
|
|
423
|
+
///
|
|
424
|
+
/// \param resultDelegate where you will receive scanned result
|
|
425
|
+
///
|
|
426
|
+
+ (void)scanFromGalleryWithBkdConfig:(BarkoderConfig * _Nonnull)bkdConfig resultDelegate:(id <BarkoderResultDelegate> _Nonnull)resultDelegate;
|
|
417
427
|
/// Apply config params from predefined template
|
|
418
428
|
/// \param config that will be configured
|
|
419
429
|
///
|
|
@@ -465,6 +475,7 @@ typedef SWIFT_ENUM(NSInteger, BarkoderConfigTemplate, open) {
|
|
|
465
475
|
};
|
|
466
476
|
|
|
467
477
|
|
|
478
|
+
|
|
468
479
|
SWIFT_PROTOCOL("_TtP11BarkoderSDK27BarkoderPerformanceDelegate_")
|
|
469
480
|
@protocol BarkoderPerformanceDelegate
|
|
470
481
|
@optional
|