Skip to content

Commit 8f78666

Browse files
author
build - Buildozer
committed
New version of iOS CaptureSDK - Swift Package Manager
1 parent 6a3846e commit 8f78666

32 files changed

+1729
-1862
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
# Change Log
22
This file tracks released versions with the changes made to this project.
33

4+
## Version 2.0.29
5+
6+
### New
7+
8+
* N/A
9+
10+
11+
### Improvements
12+
13+
* Our SocketCam C860 has been improved to aim barcodes within the view finder
14+
15+
* CaptureHelper has some breaking changes to end the transition for a better CaptureSDK 2.0
16+
17+
* We have removed CryptoSwift as a dependency of our CaptureSDK
18+
19+
20+
21+
### Bug fixes
22+
23+
* We have fixed the D600 connection
24+
25+
26+
427
## Version 2.0.16
528

629
### New

Package.swift

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ let package = Package(
1515
.library(
1616
name: "CaptureSDK",
1717
targets: [
18-
"CaptureSDKFramework", "SwiftDecoderCaptureSDK", "CryptoSwiftCaptureSDK"
18+
"CaptureSDKFramework", "SwiftDecoderCaptureSDK"
1919
]
2020
)
2121
],
2222
dependencies: [
23-
.package(url: "https://github.com/SocketMobile/swift-package-swiftdecodersdk.git", exact: "6.2.3"),
24-
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "1.6.0")
23+
.package(url: "https://github.com/SocketMobile/swift-package-swiftdecodersdk.git", exact: "6.2.3")
2524
],
2625
targets: [
2726
.target(
@@ -36,13 +35,6 @@ let package = Package(
3635
],
3736
path: "Sources/SwiftDecoderDummy"
3837
),
39-
.target(
40-
name: "CryptoSwiftCaptureSDK",
41-
dependencies: [
42-
.product(name: "CryptoSwift", package: "CryptoSwift"),
43-
],
44-
path: "Sources/CryptoSwiftDummy"
45-
),
4638
.binaryTarget(
4739
name: "CaptureSDKBinaryTarget",
4840
path: "Sources/CaptureSDK.xcframework"

README.md

Lines changed: 3 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CaptureSDK Version 2.0.16 - Swift Package Manager
1+
# CaptureSDK Version 2.0.29 - Swift Package Manager
22

33
Socket Mobile is a leading innovator of data capture and delivery solutions for enhanced productivity.
44

@@ -124,123 +124,14 @@ Once `CaptureSDK` is open, then the device arrival notification can occurs as so
124124

125125
The decoded data coming from the scanner can be retrieved by overriding the `onDecodedData` delegate.
126126

127-
### 4. Summary for integrating `CaptureSDK` in a Xcode project
128-
129-
Example of ViewController.m for SingleEntry app:
130-
131-
```swift
132-
import UIKit
133-
import CaptureSDK
134-
135-
class MasterViewController:
136-
UITableViewController,
137-
CaptureHelperDevicePresenceDelegate,
138-
CaptureHelperDeviceManagerPresenceDelegate,
139-
CaptureHelperDeviceDecodedDataDelegate,
140-
CaptureHelperErrorDelegate,
141-
CaptureHelperDevicePowerDelegate {
142-
143-
144-
// Capture Helper shareInstance allows to share
145-
// the same instance of Capture Helper with the
146-
// entire application. That static property can
147-
// be used in any views but it is recommended
148-
// to open only once Capture Helper (in the main
149-
// view controller) and pushDelegate, popDelegate
150-
// each time a new view requiring scanning capability
151-
// is loaded or unloaded respectively.
152-
var captureHelper = CaptureHelper.sharedInstance
153-
154-
override func viewDidLoad() {
155-
super.viewDidLoad()
156-
// Do any additional setup after loading the view, typically from a nib.
157-
// fill out the App Info with the Bundle ID which should start by the
158-
// platform on which the application is running and followed with the
159-
// case sensitive application Bundle ID,
160-
// with the Socket Mobile Portal developer ID
161-
// and with the Application Key generated from the Socket Mobile Developer
162-
// portal
163-
let AppInfo = SKTAppInfo()
164-
AppInfo.appKey = "MC0CFQD1tdTpaABkppmG+iP3dB9kolYVtwIUY8c3UmEfaPoTI3AxbPOTpNgw+fo="
165-
AppInfo.appID = "ios:com.socketmobile.SingleEntrySwift"
166-
AppInfo.developerID = "bb57d8e1-f911-47ba-b510-693be162686a"
167-
168-
// there is a stack of delegates the last push is the
169-
// delegate active, when a new view requiring notifications from the
170-
// scanner, then push its delegate and pop its delegate when the
171-
// view is done
172-
captureHelper.pushDelegate(self)
173-
174-
// to make all the delegates able to update the UI without the app
175-
// having to dispatch the UI update code, set the dispatchQueue
176-
// property to the DispatchQueue.main
177-
captureHelper.dispatchQueue = DispatchQueue.main
178-
179-
// open Capture Helper only once in the application
180-
captureHelper.openWithAppInfo(AppInfo, withCompletionHandler: { (_ result: SKTResult) in
181-
print("Result of Capture initialization: \(result.rawValue)")
182-
})
183-
}
184-
}
185-
```
186-
187-
`CaptureHelper` makes the application aware of a new device connection by invoking the `onDeviceArrival` of the protocol and, in the same way when a device disconnects, the `onDeviceRemoval` is invoked. A `CaptureHelper` device instance representing the device that is connected can be used to retrieve or set a device property.
188-
189-
Example of the view controller being aware of the scanner:
190-
191-
```swift
192-
func didNotifyArrivalForDevice(_ device: CaptureHelperDevice, withResult result: SKTResult) {
193-
print("Main view device arrival:\(device.deviceInfo.name!)")
194-
}
195-
196-
func didNotifyRemovalForDevice(_ device: CaptureHelperDevice, withResult result: SKTResult) {
197-
print("Main view device removal:\(device.deviceInfo.name!)")
198-
}
199-
```
200-
201-
For a combo device like the S370 which has 2 devices, there will be two ``didNotifyArrivalForDevice`` and two ``didNotifyRemovalForDevice`` notifications.
202-
203-
The following code shows how you can distinghuish and handle them:
204-
205-
```swift
206-
func didNotifyArrivalForDevice(_ device: CaptureHelperDevice, withResult result: SKTResult) {
207-
print("didNotifyArrivalForDevice: \(String(describing: device.deviceInfo.name))")
208-
if device.deviceInfo.deviceType == .NFCS370 {
209-
// handle the NFC reader of the S370
210-
} else if device.deviceInfo.deviceType == .scannerS370 {
211-
// handle the Barcode scanner of the S370
212-
}
213-
}
214-
```
215-
216-
If the scanner triggers a scan, the decoded data can be retrieve in the protocol function `onDecodedData`.
217-
218-
Example of retrieving the decoded data received by a scanner:
219-
220-
```swift
221-
func didReceiveDecodedData(_ decodedData: SKTCaptureDecodedData?, fromDevice device: CaptureHelperDevice, withResult result: SKTResult) {
222-
if result == SKTCaptureErrors.E_NOERROR {
223-
let rawData = decodedData?.decodedData
224-
let rawDataSize = rawData?.count
225-
print("Size: \(String(describing: rawDataSize))")
226-
print("data: \(String(describing: decodedData?.decodedData))")
227-
let string = decodedData?.stringFromDecodedData()!
228-
print("Decoded Data \(String(describing: string))")
229-
}
230-
}
231-
```
232-
233-
The application can retrieve or modify the device properties by calling the various `CaptureHelperDevice` get/set methods. By example there is a method to retrieve the device friendly name: `getFriendlyNameWithCompletionHandler`. The call is asynchronous and will return immediately. The final result and the friendly name can be retrieved in the
234-
completion handler function block.
235-
236127
**IMPORTANT**:
237128
If a property is not accessible through the available `CaptureHelper` methods, it is very easy to add new ones, by creating a `CaptureHelper` **extension** class and copy and paste a similar get/set method and change the property settings inside the new method.
238129

239130
Creating a `CaptureHelper` extension allows to avoid an overwrite of a modified version of `CaptureHelper` when updating to a more recent `CaptureSDK` CocoaPods.
240131

241-
## Sample code
132+
### 4. Sample code
242133

243-
Sample code can be found in [GitHub / SocketMobile](https://github.com/SocketMobile "Socket Mobile Samples")
134+
Try out our sample [our Single Entry app on Github SocketMobile](https://github.com/SocketMobile/capturesingleentryswift-ios)
244135

245136
## SocketCam C820 and C860
246137

Sources/CaptureSDK.xcframework/Info.plist

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,32 @@
88
<key>BinaryPath</key>
99
<string>CaptureSDK.framework/CaptureSDK</string>
1010
<key>LibraryIdentifier</key>
11-
<string>ios-arm64_x86_64-simulator</string>
11+
<string>ios-arm64</string>
1212
<key>LibraryPath</key>
1313
<string>CaptureSDK.framework</string>
1414
<key>SupportedArchitectures</key>
1515
<array>
1616
<string>arm64</string>
17-
<string>x86_64</string>
1817
</array>
1918
<key>SupportedPlatform</key>
2019
<string>ios</string>
21-
<key>SupportedPlatformVariant</key>
22-
<string>simulator</string>
2320
</dict>
2421
<dict>
2522
<key>BinaryPath</key>
2623
<string>CaptureSDK.framework/CaptureSDK</string>
2724
<key>LibraryIdentifier</key>
28-
<string>ios-arm64</string>
25+
<string>ios-arm64_x86_64-simulator</string>
2926
<key>LibraryPath</key>
3027
<string>CaptureSDK.framework</string>
3128
<key>SupportedArchitectures</key>
3229
<array>
3330
<string>arm64</string>
31+
<string>x86_64</string>
3432
</array>
3533
<key>SupportedPlatform</key>
3634
<string>ios</string>
35+
<key>SupportedPlatformVariant</key>
36+
<string>simulator</string>
3737
</dict>
3838
</array>
3939
<key>CFBundlePackageType</key>
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)