Skip to content

Commit 6985ba6

Browse files
author
build - Buildozer
committed
New version of iOS CaptureSDK - Cocoapods
1 parent 22eef1d commit 6985ba6

32 files changed

+1759
-1856
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

CaptureSDK.podspec

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "CaptureSDK"
3-
s.version = "2.0.16"
3+
s.version = "2.0.29"
44
s.summary = "CaptureSDK for Socket Mobile wireless devices."
55
s.homepage = "https://socketmobile.com"
66
s.license = { :type => "COMMERCIAL", :file => "LICENSE" }
@@ -9,7 +9,7 @@ Pod::Spec.new do |s|
99
s.platform = :ios, "15.0"
1010
s.source = {
1111
:git => "https://github.com/SocketMobile/cocoapods-capturesdk.git",
12-
:tag => "2.0.16"
12+
:tag => "2.0.29"
1313
}
1414
s.ios.deployment_target = "15.0"
1515
s.swift_version = "5.0"
@@ -20,6 +20,5 @@ Pod::Spec.new do |s|
2020
s.frameworks = "ExternalAccessory", "AudioToolbox", "AVFoundation", "CoreBluetooth"
2121

2222
s.dependency "SwiftDecoderSDK", "~> 6.2.3"
23-
s.dependency "CryptoSwift", ">= 1.6.0", "< 2.0"
2423

2524
end

README.md

Lines changed: 33 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CaptureSDK Version 2.0.16 - Cocoapods
1+
# CaptureSDK Version 2.0.29 - Cocoapods
22

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

@@ -22,6 +22,36 @@ More documentation can be found [here in our CaptureSDK Documentation](https://d
2222

2323
**- Write some code to fit the Bluetooth discovery flow to your application's design by creating an UI that starts and shows discovered devices and select them to be paired to your application.**
2424

25+
We also have deprecated some CaptureHelper methods to avoid confusion and got rid of the `Device Manager`.
26+
27+
Here's the changes in a nutshell:
28+
29+
- The protocol **CaptureHelperDeviceManagerDelegate** will be removed and its methods **didNotifyArrivalForDeviceManager** and **didNotifyRemovalForDeviceManager** will be removed as well.
30+
31+
- The protocol **CaptureHelperDeviceManagerDiscoveryDelegate** will be renamed to **CaptureHelperDiscoveryDelegate**. Its methods **didDiscoverDevice(device:deviceManager:)** and **didEndDiscoveryWithResult(result:deviceManager:)** will be renamed to **didDiscoverDevice(device:)** and **didEndDiscoveryWithResult(result:)** respectively.
32+
33+
- The class **CaptureHelperDeviceManager** will be removed. You can use its methods directly from **CaptureHelper**. For instance:
34+
35+
```swift
36+
bleDeviceManager.connectToDiscoveredDevice(device) { result in
37+
print("connectToDiscoveredDevice returns: \(result.rawValue)")
38+
}
39+
40+
/// Becomes:
41+
42+
CaptureHelper.sharedInstance.connectToDiscoveredDevice(device) { result in
43+
print("connectToDiscoveredDevice returns: \(result.rawValue)")
44+
}
45+
46+
/// You can use a CaptureHelper variable instead of the singleton instance as well.
47+
```
48+
49+
- The **CaptureHelperDeviceManager** methods **setFavoriteDevices(favorites:)**, **getFavoriteDevicesWithCompletionHandler** will be removed. No favorites management is needed anymore in CaptureSDK 2.0.
50+
51+
- The **CaptureHelperDeviceManager** method **startDiscoveryWithTimeout(timeout:)** is replaced by **addBluetoothDevice(bluetoothDiscoveryMode:)** in the main **CaptureHelper** class.
52+
53+
- The **CaptureHelperDeviceManager** methods **getDeviceUniqueIdentifierFromDeviceGuid(deviceGuid:)**, **connectToDiscoveredDevice(device:)**, **disconnectFromDiscoveredDevice(device:)** are moved to the main **CaptureHelper** class.
54+
2555
[See our Getting Started section in our documentation](https://docs.socketmobile.dev/capture/ios/en/latest/gettingStarted.html)
2656

2757
## Devices compatibility and CaptureSDK versions
@@ -146,7 +176,6 @@ scanner.setTrigger(.start, withCompletionHandler: { result, propertyObject in
146176

147177
DispatchQueue.main.async {
148178
if let anObject = propertyObject?.object, let dic = anObject as? [String: Any], let objectType = dic["SKTObjectType"] as? String, objectType == "SKTSocketCamViewControllerType", let socketCamViewController = dic["SKTSocketCamViewController"] as? UIViewController {
149-
150179
////
151180
// Present the socketCamViewController in a popover or a subview or in full screen
152181
////
@@ -226,123 +255,14 @@ Once `CaptureSDK` is open, then the device arrival notification can occurs as so
226255

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

229-
### 4. Summary for integrating `CaptureSDK` in a Xcode project
230-
231-
Example of ViewController.m for SingleEntry app:
232-
233-
```swift
234-
import UIKit
235-
import CaptureSDK
236-
237-
class MasterViewController:
238-
UITableViewController,
239-
CaptureHelperDevicePresenceDelegate,
240-
CaptureHelperDeviceManagerPresenceDelegate,
241-
CaptureHelperDeviceDecodedDataDelegate,
242-
CaptureHelperErrorDelegate,
243-
CaptureHelperDevicePowerDelegate {
244-
245-
246-
// Capture Helper shareInstance allows to share
247-
// the same instance of Capture Helper with the
248-
// entire application. That static property can
249-
// be used in any views but it is recommended
250-
// to open only once Capture Helper (in the main
251-
// view controller) and pushDelegate, popDelegate
252-
// each time a new view requiring scanning capability
253-
// is loaded or unloaded respectively.
254-
var captureHelper = CaptureHelper.sharedInstance
255-
256-
override func viewDidLoad() {
257-
super.viewDidLoad()
258-
// Do any additional setup after loading the view, typically from a nib.
259-
// fill out the App Info with the Bundle ID which should start by the
260-
// platform on which the application is running and followed with the
261-
// case sensitive application Bundle ID,
262-
// with the Socket Mobile Portal developer ID
263-
// and with the Application Key generated from the Socket Mobile Developer
264-
// portal
265-
let AppInfo = SKTAppInfo()
266-
AppInfo.appKey = "MC0CFQD1tdTpaABkppmG+iP3dB9kolYVtwIUY8c3UmEfaPoTI3AxbPOTpNgw+fo="
267-
AppInfo.appID = "ios:com.socketmobile.SingleEntrySwift"
268-
AppInfo.developerID = "bb57d8e1-f911-47ba-b510-693be162686a"
269-
270-
// there is a stack of delegates the last push is the
271-
// delegate active, when a new view requiring notifications from the
272-
// scanner, then push its delegate and pop its delegate when the
273-
// view is done
274-
captureHelper.pushDelegate(self)
275-
276-
// to make all the delegates able to update the UI without the app
277-
// having to dispatch the UI update code, set the dispatchQueue
278-
// property to the DispatchQueue.main
279-
captureHelper.dispatchQueue = DispatchQueue.main
280-
281-
// open Capture Helper only once in the application
282-
captureHelper.openWithAppInfo(AppInfo, withCompletionHandler: { (_ result: SKTResult) in
283-
print("Result of Capture initialization: \(result.rawValue)")
284-
})
285-
}
286-
}
287-
```
288-
289-
`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.
290-
291-
Example of the view controller being aware of the scanner:
292-
293-
```swift
294-
func didNotifyArrivalForDevice(_ device: CaptureHelperDevice, withResult result: SKTResult) {
295-
print("Main view device arrival:\(device.deviceInfo.name!)")
296-
}
297-
298-
func didNotifyRemovalForDevice(_ device: CaptureHelperDevice, withResult result: SKTResult) {
299-
print("Main view device removal:\(device.deviceInfo.name!)")
300-
}
301-
```
302-
303-
For a combo device like the S370 which has 2 devices, there will be two ``didNotifyArrivalForDevice`` and two ``didNotifyRemovalForDevice`` notifications.
304-
305-
The following code shows how you can distinghuish and handle them:
306-
307-
```swift
308-
func didNotifyArrivalForDevice(_ device: CaptureHelperDevice, withResult result: SKTResult) {
309-
print("didNotifyArrivalForDevice: \(String(describing: device.deviceInfo.name))")
310-
if device.deviceInfo.deviceType == .NFCS370 {
311-
// handle the NFC reader of the S370
312-
} else if device.deviceInfo.deviceType == .scannerS370 {
313-
// handle the Barcode scanner of the S370
314-
}
315-
}
316-
```
317-
318-
If the scanner triggers a scan, the decoded data can be retrieve in the protocol function `onDecodedData`.
319-
320-
Example of retrieving the decoded data received by a scanner:
321-
322-
```swift
323-
func didReceiveDecodedData(_ decodedData: SKTCaptureDecodedData?, fromDevice device: CaptureHelperDevice, withResult result: SKTResult) {
324-
if result == SKTCaptureErrors.E_NOERROR {
325-
let rawData = decodedData?.decodedData
326-
let rawDataSize = rawData?.count
327-
print("Size: \(String(describing: rawDataSize))")
328-
print("data: \(String(describing: decodedData?.decodedData))")
329-
let string = decodedData?.stringFromDecodedData()!
330-
print("Decoded Data \(String(describing: string))")
331-
}
332-
}
333-
```
334-
335-
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
336-
completion handler function block.
337-
338258
**IMPORTANT**:
339259
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.
340260

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

343-
## Sample code
263+
### 4. Sample code
344264

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

347267
## Configure and connect a Socket Mobile device
348268

lib/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)