For Picqer we are experimenting with barcode scanner sleds. (You can connect it to a iOS device and use it in warehouses instead of old and expensive Windows CE devices.) After reviewing the Honeywell Captuvo’s and the Linea Pro’s, we decided to try the Captuvo’s first.
The SDK looked very easy to use. Drop in 2 libraries, write 5-6 lines of code and it should work.
But after a day of trying I could not get it to work. Also my colleague @stephangroen ran into the same problems the day after. We could retrieve the serial number and battery status. But after we ‘start’ the barcode scanner, the lights stay out.
The missing plist entry
At the end of the second day I found an abandoned forum with an extra entry to the Info.plist. Looked like exactly something we were missing. We tried it in 2 minutes and now it worked. And it worked flawlessly.
The missing entry, add this to your main Info.plist:
The plist entry is never mentioned in the docs. Also the docs are too much text for some really easy steps. So perfect for this first blog post to create a comprehansive how-to. :)
These are the minimum steps to get the Honeywell Captuvo to work in your iOS project:
- Get the Captuvo SDK from honeywellaidc.com, you can download it directly after you fill in the form
- Drag the Captuvo.h file into the file tree on the left in Xcode (in the pop-up check ‘copy items if needed’ and all targets)
- To the same with the libCaptuvoSDK.a file
- Go to your project settings (click the first item in the file tree), click on the General tab, at Linked Frameworks and Libraries add ExternalAccessory.framework
- Open the Info.plist and add “Supported external accessory protocols” key as an array with item 0 as string with the contents “com.honeywell.scansled.protocol.decoder”
- Open AppDelegate.h and add ‘#import “Captuvo.h”’ at the top and add “CaptuvoEventsProtocol” as extra delegate, like this:
- Open AppDelegate.m and add the following code:
Now you can build your app, put it on a iOS device and it should work. You now get a UIAlert for every barcode you scanned.
Hope this helps the next developer wasting a day :) If you have any questions regarding this, ping me on twitter: @casperbakker