Barcode Scanner - iOS Issues

16 posts, 0 answers
  1. Bill
    Bill avatar
    75 posts
    Member since:
    Feb 2013

    Posted 10 Jul 2013 Link to this post

    I was wondering if anyone else was experiencing barcode capture issues on iOS devices using the barcode scanner plugin in Icenium.  

    I've tested the barcode plugin on Android and iOS devices and it appears that Android devices are able to capture many barcodes that iOS can't.  The barcodes I am testing with are VIN barcodes off vehicles.

    Any suggestions for improving capture rate on iOS devices with the plugin would be helpful.  Thanks.

    Icenium Ion
    Cordova: 2.7.0
    Barcode Scanner Plugin: 0.3.0
  2. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 10 Jul 2013 Link to this post

    Hi Bill,

     The BarcodeScanner plugin relies on the zebra crossing (zing) library, which is more feature-complete on Android. The iOS port is written in C++ and supports only a number of the features that the original Java library supports.

    Regards,
    Yavor Georgiev
    Telerik

    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Missed our first webinar, watch it here.
    Share feedback and vote for features on our Feedback Portal.
  3. Bill
    Bill avatar
    75 posts
    Member since:
    Feb 2013

    Posted 11 Jul 2013 Link to this post

    Thanks Yavor, that was helpful.  The Barcode Scanner for iOS can scan type UPC_A barcodes fine.  However the VIN barcodes will not work.  VIN barcodes appear to be type: Code_39.  Can you direct me to the iOS C++ dependency documentation so that I can see what barcode types are supported for iOS?

    Would writing a custom plugin be an option here?  A custom barcode plugin that uses a different iOS barcode library?
  4. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 11 Jul 2013 Link to this post

    Hello Bill,

     I'm afraid I can't find any documentation on the C++ port of zxing. Perhaps you can try asking on their forum?

     As to your second question: yes, you can use any other plugin, as long as it can be made plugman-compatible. Unfortunately I don't know of a Cordova plugin that uses another scanning library.

    Regards,
    Yavor Georgiev
    Telerik

    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Missed our first webinar, watch it here.
    Share feedback and vote for features on our Feedback Portal.
  5. Bill
    Bill avatar
    75 posts
    Member since:
    Feb 2013

    Posted 15 Jul 2013 Link to this post

    I posted in their forums about a week ago and I've had no response.  

    I looked on their site and it appears the iOS port that icenium's plugin is using, only supports QR codes.

    • iphone: iPhone client + port to Objective C / C++ (QR code only)
    I did find a port of ZXing for iOS which has a wider range of barcode support:

    https://github.com/TheLevelUp/ZXingObjC

    Do I have any additional options on this?  Scanning Code 39 barcodes is required for my application.
  6. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 15 Jul 2013 Link to this post

    Hello Bill,

    The BarcodeScanner is a 3rd party plug-in, which we integrated into Icenium as it was highly requested and we did not have support for custom plug-ins at that time. With that said we have absolutely no control over that plug-in and how it develops (what library it uses). You can contact its author and suggest switching to that library for the iOS part of the plug-in or post to the plug-in Issues page about the limited barcode support.

    Apart from that, you can wait for a plug-in based on the Obj C port of the library you've found to appear or be the one that creates it.

    Regards,
    Steve
    Telerik

    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Missed our first webinar, watch it here.
    Share feedback and vote for features on our Feedback Portal.
  7. Bill
    Bill avatar
    75 posts
    Member since:
    Feb 2013

    Posted 18 Jul 2013 Link to this post

    Thanks Steve for the information.  I created and issue on the barcode plug-in's project and they said that Code 39 is supported...  they just hadn't updated the documentation yet.

    Icenium's barcode scanner is 6 months out of date.  The current version is 0.6.0.  Perhaps the Code 39 support was added > 0.3.0.  When will Icenium update the barcode scanner plug-in so we can try out the latest version?
  8. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 19 Jul 2013 Link to this post

    Hi Bill,

    We would no longer be updating the plug-ins that are currently built-in in Icenium, because since v.1.6 we have added support for custom Cordova plug-ins. This means that you could go grab the latest version of the BarcodeScanner plug-in and use it into your app. For more information on that, please follow the instructions from the referenced documentation.

    Regards,
    Steve
    Telerik

    Do you enjoy Icenium? Vote for it as your favorite new product here (use short code H048S).
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  9. Bill
    Bill avatar
    75 posts
    Member since:
    Feb 2013

    Posted 19 Jul 2013 Link to this post

    I have downloaded the latest Barcode plug-in and followed the custom-plugin documentation.

    Barcode Plug-In: https://github.com/wildabeast/BarcodeScanner
    Documentation: http://docs.icenium.com/creating-your-project/using-plugins/using-custom-plugins/using-custom-plugins

    I have imported the BarcodeScanner into my Icenium project, I've added my script include, looked for comments/blocks for other cordova versions which are != to 2.7.0, but there are none.  When I try to build, I get import errors on the Java build.  See below.  Any thoughts?

    [javac] Compiling 11 source files to /tmp/51dd038405d14a98aa68ffd0b02a9916/bin/classes
        [javac] /tmp/51dd038405d14a98aa68ffd0b02a9916/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:19: cannot find symbol
        [javac] symbol  : class Plugin
        [javac] location: package org.apache.cordova.api
        [javac] import org.apache.cordova.api.Plugin;
        [javac]                              ^
        [javac] /tmp/51dd038405d14a98aa68ffd0b02a9916/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:25: cannot find symbol
        [javac] symbol: class Plugin
        [javac] public class BarcodeScanner extends Plugin {
        [javac]                                     ^
        [javac] /tmp/51dd038405d14a98aa68ffd0b02a9916/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:101: cannot find symbol
        [javac] symbol  : class Plugin
        [javac] location: class com.phonegap.plugins.barcodescanner.BarcodeScanner
        [javac]         this.cordova.startActivityForResult((Plugin) this, intentScan, REQUEST_CODE);
        [javac]                                              ^
        [javac] /tmp/51dd038405d14a98aa68ffd0b02a9916/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:101: cannot find symbol
        [javac] symbol  : variable cordova
        [javac] location: class com.phonegap.plugins.barcodescanner.BarcodeScanner
        [javac]         this.cordova.startActivityForResult((Plugin) this, intentScan, REQUEST_CODE);
        [javac]             ^
        [javac] /tmp/51dd038405d14a98aa68ffd0b02a9916/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:123: cannot find symbol
        [javac] symbol  : method success(org.apache.cordova.api.PluginResult,java.lang.String)
        [javac] location: class com.phonegap.plugins.barcodescanner.BarcodeScanner
        [javac]                 this.success(new PluginResult(PluginResult.Status.OK, obj), this.callback);
        [javac]                     ^
        [javac] /tmp/51dd038405d14a98aa68ffd0b02a9916/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:133: cannot find symbol
        [javac] symbol  : method success(org.apache.cordova.api.PluginResult,java.lang.String)
        [javac] location: class com.phonegap.plugins.barcodescanner.BarcodeScanner
        [javac]                 this.success(new PluginResult(PluginResult.Status.OK, obj), this.callback);
        [javac]                     ^
        [javac] /tmp/51dd038405d14a98aa68ffd0b02a9916/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:135: cannot find symbol
        [javac] symbol  : method error(org.apache.cordova.api.PluginResult,java.lang.String)
        [javac] location: class com.phonegap.plugins.barcodescanner.BarcodeScanner
        [javac]                 this.error(new PluginResult(PluginResult.Status.ERROR), this.callback);
        [javac]                     ^
        [javac] /tmp/51dd038405d14a98aa68ffd0b02a9916/src/com/phonegap/plugins/barcodescanner/BarcodeScanner.java:150: cannot find symbol
        [javac] symbol  : variable cordova
        [javac] location: class com.phonegap.plugins.barcodescanner.BarcodeScanner
        [javac]         this.cordova.getActivity().startActivity(intentEncode);
        [javac]             ^
        [javac] 8 errors
  10. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 19 Jul 2013 Link to this post

    Hi Bill,

    It looks like the BarcodeScanner plugin hasn't been updated to match the Cordova 2.7 plugin API. More information about the migration process can be found in the following blog post: Why Don't My Plugins Work in PhoneGap Android 2.7?

    Regards,
    Steve
    Telerik

    Do you enjoy Icenium? Vote for it as your favorite new product here (use short code H048S).
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  11. Bill
    Bill avatar
    75 posts
    Member since:
    Feb 2013

    Posted 19 Jul 2013 Link to this post

    Thanks Steve!  Almost there!  Successful build and deploy now :)

    Now the app isn't able to invoke the plugin from javascript.  I'm guessing my js include is wrong, however I followed the documentation.

    plugin.xml asset:  <asset src="www/barcodescanner.js" target="barcodescanner.js" />

    Documentation states that I should use the path of the target for my include in my index.html.  So this is what I did but it doesn't seem to work.

    <script src="cordova.js"></script>
    <script src="barcodescanner.js" type="text/javascript"></script>
  12. Bill
    Bill avatar
    75 posts
    Member since:
    Feb 2013

    Posted 19 Jul 2013 Link to this post

    Steve, I figured it out.  It looks like the wildabeast barcodescanner.js is different than what icenium's is.  The icenium version registers the plugin totally different.  I ended up finding the differences between the two .js files and found a good way to register the plugin.

    It looks like I'm good for now.  Thanks so much for all your help!
  13. Dean
    Dean avatar
    1 posts
    Member since:
    Feb 2014

    Posted 21 Feb 2014 in reply to Bill Link to this post

    Bill, we are also looking for a CODE39 IOS scanner. What did you end up using to get yours to work?
  14. Bill
    Bill avatar
    75 posts
    Member since:
    Feb 2013

    Posted 21 Feb 2014 in reply to Dean Link to this post

    The standard plugin included is actually:  https://github.com/wildabeast/BarcodeScanner

    I created an issue found here: https://github.com/wildabeast/BarcodeScanner/issues/26

    Another thread will detailed info:  https://github.com/wildabeast/BarcodeScanner/issues/34

    Bottom line: The plugin does support code 39 on iOS, however most will not register well for various reasons.  We needed it for VIN vehicle barcode scanning and it will not work.  We have since disabled the scanning on iOS and only allow it on Android.  So we didn't find a solution.
  15. paul
    paul avatar
    2 posts
    Member since:
    Sep 2014

    Posted 07 Oct 2014 Link to this post


    <a href="http://www.onbarcode.com/products/iphone_barcode/" target="_blank">iphone Barcode Generator</a> Quick Start

    Sample Objective-C code:


    - (void)drawRect:(CGRect)rect {
    // Drawing code

    OBLinear *pLinear = [OBLinear new];
    [pLinear setNBarcodeType: OB_CODE128A];
    [pLinear setPDataMsg: [[NSString alloc] initWithString: (@"AB")]];
    //[pLinear setPSupData: [[NSString alloc] initWithString: (@"14562")]];
    [pLinear setFX: USER_DEF_BAR_WIDTH];
    [pLinear setFY: USER_DEF_BAR_HEIGHT];

    [pLinear setFLeftMargin: (USER_DEF_LEFT_MARGIN)];
    [pLinear setFRightMargin: (USER_DEF_RIGHT_MARGIN)];
    [pLinear setFTopMargin: (USER_DEF_TOP_MARGIN)];
    [pLinear setFBottomMargin: (USER_DEF_BOTTOM_MARGIN)];

    [pLinear setNRotate: (OB_Rotate0)];

    UIFont *pTextFont = [UIFont fontWithName: @"Arial" size: 8.0f];
    [pLinear setPTextFont: pTextFont];

    [pLinear drawWithView: (self)];
    [pLinear release];
  16. Minh
    Minh avatar
    1 posts
    Member since:
    Apr 2015

    Posted 11 Apr 2015 Link to this post

    good
Back to Top