Getting Started with CaptureSDK for iOS¶
Requirements¶
The Socket Mobile CaptureSDK uses Bluetooth Classic through the External Accessory framework for the barcode scanner products and Bluetooth Low Energy (BLE) for the Contactless Reader/Writer products (Such as the Socket Mobile D600 and S550).
For applications that need to work with barcode scanners, make sure the following requirements are met:
Your application needs to be registered in our whitelist before submitting your application to the Apple Store. It will not pass the Apple Store review if this is not done.
Your application’s
Info.plist
MUST have the keyLSApplicationQueriesSchemes
(Queried URL Schemes) with a new item:sktcompanion
(in lower case).Your application’s
Info.plist
MUST have the keyNSCameraUsageDescription
with a string value explaining to the user how the app uses the camera for camera scanning purpose.- Your application’s
Info.plist
MUST have the keyUISupportedExternalAccessoryProtocols
(Supported External Protocol) with a new item:com.socketmobile.chs
(in lower case).
- Your application’s
Your application’s
Info.plist
MUST have the keyNSBluetoothAlwaysUsageDescription
with a string value explaining to the user how the app uses this data. This is an iOS/Apple requirement for applications that use the CoreBluetooth framework. Without it, your application will crash with a message in the Xcode console explaining that you must add the description key. Additionally, if your application has a deployment target earlier than iOS 13.0, you will need to addNSBluetoothPeripheralUsageDescription
along with theNSBluetoothAlwaysUsageDescription
. More information can be found here in the official Apple DocumentationYour application’s
Info.plist
MUST have the keyCFBundleAllowMixedLocalizations
(Localized resources can be mixed) to `YES`.Your application will need a SocketMobile AppKey. Follow the link to create an AppKey. AppKeys can be generated online and at no additional cost beyond the nominal registration fee. The AppKey is validated by the SDK library on the device, no internet connection is required. Note: You don’t need to create your own AppKey to compile and run the sample apps.
You can install CaptureSDK through Swift Package Manager or CocoaPods.
The scanner needs to be paired with your devices in Application Mode. This can be done using Socket Mobile Companion app (recommended), which can be downloaded from the App Store . To pair your scanner in Application Mode without using Companion app, follow the instructions at: Configure and Pair Socket Mobile Devices in Application Mode for iOS.
Try the sample app Single Entry in Swift.
Using CaptureSDK¶
The easiest way to use the CaptureSDK in your application is to use Capture Helper, which is released in source code form as part of the CaptureSDK CocoaPods. Please refer to Capture Helper.