SocketMobile / singleentryswift-ios

Sample code for ScanAPI SDK using Swift
Other
7 stars 1 forks source link

ScanApiHelperDelegate methods not calling #6

Closed kbabulrao closed 7 years ago

kbabulrao commented 7 years ago

I am checking the 'singleentryswift-ios' project.

If we select the textfield then barcode scanner is printing the respective barcode on the textfield.

Except onScanApiInitializeComplete method the other delegate are not calling at all, if we scan any barcode. Those are (onDeviceArrival, onDeviceRemoval, onDecodedDataResult).

1.When will the delegates will be called?

  1. How the barcode is printing on the textfield (if we select the textfield and scan the barcode)?

Note: I created one sample and added one textfield in storyboard. If we run the application and select the textfield to appear keyboard, then if we scan any barcode it is giving the respective barcode number. ** How is it possible? Without integrating the ScanAPI SDK also it is returning the respective bar code.

Please guide me if i am doing any wrong.

I followed this link also https://www.youtube.com/watch?v=bVkwVp-0nwM.

I would like to show one popup when the scanner reads the barcode.

EricGlaenzer commented 7 years ago

Your Socket Mobile barcode scanner might be set to Basic Mode (set by default). The Basic Mode shows the scanner as a keyboard to the host (using the Human Input Device (HID) interface). The scanner needs to be configured in Application Mode for MFi (iOS). This is accomplished by scanning a command barcode from our documentation present on our website.
By example for a 1D barcode scanner you can find this Application Mode for MFi (iOS) barcode in https://www.socketmobile.com/docs/default-source/series-7/chs-1d-imager-command-barcodes-sheet.pdf?sfvrsn=10 Once the scanner is configured in Application Mode MFi, when it connects to the host, you have an optional delegate that is called: onDeviceArrival, then when a barcode is scanned the application receives the decoded data through the onDecodedDataResult. From there you can popup any dialog with the decoded data.

kbabulrao commented 7 years ago

Thank you @EricGlaenzer . It worked for me.

mfreiwald commented 7 years ago

Hey, i have the same problem for both projects (objc and swift)

The scanner is connected with the iOS device. But i only the the text input, but no other delegates called.

I set the scanner to application mode before pairing and after pairing. Both did not work.. I used this Code: #FNB00F40002#

Problems are on iOS 10 and iOS 11

EricGlaenzer commented 7 years ago

It is best to not have the scanner paired already. As soon as the scanner is paired, it tries to connect to the host and during that time it is less available for scanner a command barcode. To clear the pairing the best is to have the scanner ON, then press and hold the trigger and press the power button. A series of beeps should indicate the pairing has been deleted. Then turn ON the scanner again, scan the barcode command to configure the scanner in Application mode for MFi. I should also point out that the pairing should be remove on the host as well. Go to the iOS Bluetooth settings and select the (i) on the same line of the scanner, then click "Forget this device". It is recommended to always clear pairing information on both side (host and scanner). I hope this will fix your issue, let us know otherwise. (There are also a ScannerSettings application on the App Store which has this command barcode as well as the Reset to Factory default one, but careful with the Reset to Factory barcode as it will put the scanner back into Basic Mode (HID-Keyboard emulation) )

mfreiwald commented 7 years ago

I got it, a had the wrong codes.. The examples a working, only my app has some problems... but thats not the problem with the sdk. Thanks