Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ to represent the hint for the type of barcode to be scanned.

Defines the options for configuring a barcode scan.

<code>{ hint: <a href="#capacitorbarcodescannertypehint">CapacitorBarcodeScannerTypeHint</a>; scanInstructions?: string; scanButton?: boolean; scanText?: string; cameraDirection?: <a href="#capacitorbarcodescannercameradirection">CapacitorBarcodeScannerCameraDirection</a>; scanOrientation?: <a href="#capacitorbarcodescannerscanorientation">CapacitorBarcodeScannerScanOrientation</a>; android?: { scanningLibrary?: <a href="#capacitorbarcodescannerandroidscanninglibrary">CapacitorBarcodeScannerAndroidScanningLibrary</a>; }; web?: { showCameraSelection?: boolean; scannerFPS?: number; }; }</code>
<code>{ hint: <a href="#capacitorbarcodescannertypehint">CapacitorBarcodeScannerTypeHint</a>; scanInstructions?: string; scanButton?: boolean; scanText?: string; cameraDirection?: <a href="#capacitorbarcodescannercameradirection">CapacitorBarcodeScannerCameraDirection</a>; scanOrientation?: <a href="#capacitorbarcodescannerscanorientation">CapacitorBarcodeScannerScanOrientation</a>; /** * Accessibility label (alternative text) read by screen readers for the cancel button. * When omitted, no accessibility label is set. Has no effect on web. */ cancelButtonAccessibilityLabel?: string; /** * Accessibility label (alternative text) read by screen readers for the torch button when the torch is on. * When omitted, no accessibility label is set. Has no effect on web. */ torchButtonOnAccessibilityLabel?: string; /** * Accessibility label (alternative text) read by screen readers for the torch button when the torch is off. * When omitted, no accessibility label is set. Has no effect on web. */ torchButtonOffAccessibilityLabel?: string; android?: { scanningLibrary?: <a href="#capacitorbarcodescannerandroidscanninglibrary">CapacitorBarcodeScannerAndroidScanningLibrary</a>; }; web?: { showCameraSelection?: boolean; scannerFPS?: number; }; }</code>


### Enums
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions example-app-spm/ios/App/CapApp-SPM/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example-app-spm/ios/App/CapApp-SPM/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let package = Package(
targets: ["CapApp-SPM"])
],
dependencies: [
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", exact: "8.0.1"),
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", exact: "8.0.2"),
.package(name: "CapacitorBarcodeScanner", path: "../../../../plugin")
],
targets: [
Expand Down
3 changes: 3 additions & 0 deletions example-app-spm/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ const Home: React.FC = () => {
scanText: scanText,
cameraDirection: cameraDirection,
scanOrientation: scanOrientation,
cancelButtonAccessibilityLabel: "Cancel scanning",
torchButtonOnAccessibilityLabel: "Turn off flashlight",
torchButtonOffAccessibilityLabel: "Turn on flashlight",
android: {
scanningLibrary: androidScanningLibrary
}
Expand Down
8 changes: 4 additions & 4 deletions example-app/ios/App/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ PODS:
- CapacitorCordova
- CapacitorBarcodeScanner (3.0.2):
- Capacitor
- OSBarcodeLib (= 2.0.1)
- OSBarcodeLib (= 2.2.0)
- CapacitorCordova (8.0.2)
- OSBarcodeLib (2.0.1)
- OSBarcodeLib (2.2.0)

DEPENDENCIES:
- "Capacitor (from `../../../node_modules/.pnpm/@capacitor+ios@8.0.2_@capacitor+core@8.0.2/node_modules/@capacitor/ios`)"
Expand All @@ -26,9 +26,9 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Capacitor: 2b79172ad27f3be2d103cce88b8eb9803fdcc744
CapacitorBarcodeScanner: 421aa419ac63eeb18c7cb94ce280fa22d34e8b0b
CapacitorBarcodeScanner: 69c79a644283b98183cd603f1cfd8d5e9e4664e5
CapacitorCordova: 921bdb690ebe82421b24fce45552fd3dea2ae43a
OSBarcodeLib: 57987d2eb1f916f701f4554e20e349b3cb83f023
OSBarcodeLib: aa520d51576362d0dfea290b82653e31df1a6fc4

PODFILE CHECKSUM: d994f7d6c451be5ff31fe0d46f1283a24db43080

Expand Down
3 changes: 3 additions & 0 deletions example-app/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ const Home: React.FC = () => {
scanText: scanText,
cameraDirection: cameraDirection,
scanOrientation: scanOrientation,
cancelButtonAccessibilityLabel: "Cancel scanning",
torchButtonOnAccessibilityLabel: "Turn off flashlight",
torchButtonOffAccessibilityLabel: "Turn on flashlight",
android: {
scanningLibrary: androidScanningLibrary
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/CapacitorBarcodeScanner.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Pod::Spec.new do |s|
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
s.ios.deployment_target = '15.0'
s.dependency 'Capacitor'
s.dependency 'OSBarcodeLib', '2.0.1'
s.dependency 'OSBarcodeLib', '2.2.0'
s.swift_version = '5.1'
end
2 changes: 1 addition & 1 deletion plugin/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0"),
.package(url: "https://github.com/OutSystems/OSBarcodeLib-iOS.git", from: "2.1.1")
.package(url: "https://github.com/OutSystems/OSBarcodeLib-iOS.git", from: "2.2.0")
],
targets: [
.target(
Expand Down
2 changes: 1 addition & 1 deletion plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ to represent the hint for the type of barcode to be scanned.

Defines the options for configuring a barcode scan.

<code>{ hint: <a href="#capacitorbarcodescannertypehint">CapacitorBarcodeScannerTypeHint</a>; scanInstructions?: string; scanButton?: boolean; scanText?: string; cameraDirection?: <a href="#capacitorbarcodescannercameradirection">CapacitorBarcodeScannerCameraDirection</a>; scanOrientation?: <a href="#capacitorbarcodescannerscanorientation">CapacitorBarcodeScannerScanOrientation</a>; android?: { scanningLibrary?: <a href="#capacitorbarcodescannerandroidscanninglibrary">CapacitorBarcodeScannerAndroidScanningLibrary</a>; }; web?: { showCameraSelection?: boolean; scannerFPS?: number; }; }</code>
<code>{ hint: <a href="#capacitorbarcodescannertypehint">CapacitorBarcodeScannerTypeHint</a>; scanInstructions?: string; scanButton?: boolean; scanText?: string; cameraDirection?: <a href="#capacitorbarcodescannercameradirection">CapacitorBarcodeScannerCameraDirection</a>; scanOrientation?: <a href="#capacitorbarcodescannerscanorientation">CapacitorBarcodeScannerScanOrientation</a>; /** * Accessibility label (alternative text) read by screen readers for the cancel button. * When omitted, no accessibility label is set. Has no effect on web. */ cancelButtonAccessibilityLabel?: string; /** * Accessibility label (alternative text) read by screen readers for the torch button when the torch is on. * When omitted, no accessibility label is set. Has no effect on web. */ torchButtonOnAccessibilityLabel?: string; /** * Accessibility label (alternative text) read by screen readers for the torch button when the torch is off. * When omitted, no accessibility label is set. Has no effect on web. */ torchButtonOffAccessibilityLabel?: string; android?: { scanningLibrary?: <a href="#capacitorbarcodescannerandroidscanninglibrary">CapacitorBarcodeScannerAndroidScanningLibrary</a>; }; web?: { showCameraSelection?: boolean; scannerFPS?: number; }; }</code>


### Enums
Expand Down
2 changes: 1 addition & 1 deletion plugin/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ repositories {
}

dependencies {
implementation "io.ionic.libs:ionbarcode-android:2.0.2@aar"
implementation "io.ionic.libs:ionbarcode-android:2.1.0@aar"
implementation project(':capacitor-android')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
implementation 'androidx.activity:activity-ktx:1.11.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class CapacitorBarcodeScannerPlugin : Plugin() {
val cameraDirection = call.getInt("cameraDirection")
val scanOrientation = call.getInt("scanOrientation")
val androidScanningLibrary = call.getObject("android")?.getString("scanningLibrary")
val cancelButtonAccessibilityLabel = call.getString("cancelButtonAccessibilityLabel")
val torchButtonOnAccessibilityLabel = call.getString("torchButtonOnAccessibilityLabel")
val torchButtonOffAccessibilityLabel = call.getString("torchButtonOffAccessibilityLabel")

val parameters = OSBARCScanParameters(
scanInstructions = scanInstructions,
Expand All @@ -47,7 +50,10 @@ class CapacitorBarcodeScannerPlugin : Plugin() {
scanButton = scanButton,
scanText = scanText,
hint = hint,
androidScanningLibrary = androidScanningLibrary
androidScanningLibrary = androidScanningLibrary,
cancelButtonAccessibilityLabel = cancelButtonAccessibilityLabel,
torchButtonOnAccessibilityLabel = torchButtonOnAccessibilityLabel,
torchButtonOffAccessibilityLabel = torchButtonOffAccessibilityLabel
)

val scanIntent = Intent(activity, OSBARCScannerActivity::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ extension OSBARCScanParameters: Decodable {
case cameraDirection
case scanOrientation
case hint
case cancelButtonAccessibilityLabel
case torchButtonOnAccessibilityLabel
case torchButtonOffAccessibilityLabel
}

public init(from decoder: Decoder) throws {
Expand All @@ -32,12 +35,19 @@ extension OSBARCScanParameters: Decodable {
let hintInt = try container.decode(Int.self, forKey: .hint)
let hint = OSBARCScannerHint(rawValue: hintInt)

let cancelButtonAccessibilityLabel = try container.decodeIfPresent(String.self, forKey: .cancelButtonAccessibilityLabel)
let torchButtonOnAccessibilityLabel = try container.decodeIfPresent(String.self, forKey: .torchButtonOnAccessibilityLabel)
let torchButtonOffAccessibilityLabel = try container.decodeIfPresent(String.self, forKey: .torchButtonOffAccessibilityLabel)

self.init(
scanInstructions: scanInstructions,
scanButtonText: scanButtonText,
cameraDirection: cameraDirection,
scanOrientation: scanOrientation,
hint: hint
hint: hint,
cancelButtonAccessibilityLabel: cancelButtonAccessibilityLabel,
torchButtonOnAccessibilityLabel: torchButtonOnAccessibilityLabel,
torchButtonOffAccessibilityLabel: torchButtonOffAccessibilityLabel
)
}
}
15 changes: 15 additions & 0 deletions plugin/src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ export type CapacitorBarcodeScannerOptions = {
scanText?: string;
cameraDirection?: CapacitorBarcodeScannerCameraDirection;
scanOrientation?: CapacitorBarcodeScannerScanOrientation;
/**
* Accessibility label (alternative text) read by screen readers for the cancel button.
* When omitted, no accessibility label is set. Has no effect on web.
*/
cancelButtonAccessibilityLabel?: string;
/**
* Accessibility label (alternative text) read by screen readers for the torch button when the torch is on.
* When omitted, no accessibility label is set. Has no effect on web.
*/
torchButtonOnAccessibilityLabel?: string;
/**
* Accessibility label (alternative text) read by screen readers for the torch button when the torch is off.
* When omitted, no accessibility label is set. Has no effect on web.
*/
torchButtonOffAccessibilityLabel?: string;
android?: {
scanningLibrary?: CapacitorBarcodeScannerAndroidScanningLibrary;
};
Expand Down
Loading