Search Unity

Easy Code Scanner Unity plugin for Android and iOS

Discussion in 'Assets and Asset Store' started by C4MProdDev, Nov 22, 2012.

  1. C4MProdDev

    C4MProdDev

    Joined:
    Jul 9, 2009
    Posts:
    107
    C4M has released its Easy Code Scanner plugin on the Unity Asset store. This is the thread to discuss problems, feature requests or pre-buying inquiries.
    Thank you for interest in our Easy Code Scanner plugin.

    http://u3d.as/content/c4mprod/easy-code-scanner/3sM
     
  2. LightSky

    LightSky

    Joined:
    Aug 12, 2012
    Posts:
    45
    Any chance I can get a video of it in action? I would like to know how fast it can read in the QR codes. Also what is the compatibility with it for blurry/damaged QR codes?
    Also finally this is "fully" supported on Droid and IOS correct? No incompatibility issues for either?

    Sorry for some basic question. I would rather get them answered before buying it and not risk the chance of it not working.

    Thank you :)
     
  3. C4MProdDev

    C4MProdDev

    Joined:
    Jul 9, 2009
    Posts:
    107
    Hello,
    I quickly took two videos of the plugin in action right from the game that C4M is working on at the moment.
    In the game you unlock cards by scanning QR on real cards, and that's what I filmed with my iPhone.
    For each device, I first tap on the 'Scan QR code' button in the app. So the video also shows the time to open the camera (though that's 99% device related and not linked to plugin).

    http://www.youtube.com/watch?v=zGWM2cxVeRk
    http://www.youtube.com/watch?v=GM-PdkllISw

    In the video, once the code is scanned a request is sent to server to retrieve picture of unlocked card.
    The real time to scan is when you see the url appearing on screen.
    It's quite fast I think.

    The scanner doesn't work with blurred QR codes. That's why scanning is very tricky if the device's camera doesn't have autofocus. In that case you need to be at the right distance.
    It also doesn't work with damaged QR codes.

    However, it does also handle 1D codes :)

    Thank you for your interest in our plugin. We also have a 1.2 that is being reviewed by Unity: three release in as many months, it shows we intend to properly maintain it.

    PS:
    The devices the plugin is demoed on in the video are:
    iPhone 4S
    iPod 5
    Samsung Galaxy Note1
    Samsung Galaxy S2
     
  4. YaarMMO

    YaarMMO

    Joined:
    Jan 3, 2013
    Posts:
    42
    Looks Nice so far. I wont have the chance to try it out until later.
     
  5. Tappable

    Tappable

    Joined:
    Dec 22, 2012
    Posts:
    8
    Code Scanner doesn't return OnScannerSuccees action on successful scan on android at all
    Works on iOS but not on android. Can you double check that?

    Im using version 1.2
     
  6. C4MProdDev

    C4MProdDev

    Joined:
    Jul 9, 2009
    Posts:
    107
    Since 1.2, please make sure your Action is "OnScannerSuccess" and not anymore "OnScannerSuccees". Check also you receive something in the "onScannerMessage" callback and you have an object called "GameObject" with the script binded on it.

    On our side both Android and iPhone version run correctly (I just made a live test on both platforms).

    Get back to me if you still encounter a problem.
     
  7. Tappable

    Tappable

    Joined:
    Dec 22, 2012
    Posts:
    8
    I just done simple scene test
    Looks like it works fine on "GameObject". I have renamed "GameObject" in the scene for "QRScanner", Ive changed references in CameraActivity file.

    Then works on iOS and doesnt work on Android. Looks like there might be another place where you refer to GameObject than Camera Activity File
     
  8. C4MProdDev

    C4MProdDev

    Joined:
    Jul 9, 2009
    Posts:
    107
    Yes it is right, in camera Activity you need to rename the GameObject at line 447 and there is no other places.

    ->Have you made sure to recompile the EZCodeScanner.jar library by doing an export of the Eclipse project (and selecting only src as described in the README.txt). It should definitely come from the fact you are still using the old lib in your unity project.
     
  9. Hunkahunka

    Hunkahunka

    Joined:
    Jul 5, 2012
    Posts:
    7
    I'm currently evaluating QR Code Decoders for Unity3D. We have the following must-have requirements:
    - realtime processing from video input streams
    - processing from photo library (move and scale) (like the "scan" feature in the free App Qrafter). We want to access the photo libary on the device and move and scale a rectangular area for limiting image processing to a user-defined portion of the image.
    - access to an array with black/white information of the QR Code (ie the recognized QR code image before decoding the text)
    - support for iOS and Android platforms via Unity3D
    - support for Unity3D 3.5 and 4

    Does your Unity3D plugin Easy Code Scanner support all those requirements?
     
  10. C4MProdDev

    C4MProdDev

    Joined:
    Jul 9, 2009
    Posts:
    107
    Yep, that's in it, which is good since this is what it's made for :)

    That's not in it currently, but it's an easy addition, since this is what the plugin does internally. If you make the buy, we'll release a new version with it. However, it's not obvious to us why you'd have your user do that instead of directly scanning with your game/app?
    One thing though, we will not include move and scale in our plugin. That's something for you to build in your game/app.

    Again, that's what the plugin does right before decoding it, so it would be an easy addition. But I fail to see the end user use case. Can you elaborate on that one to help us take the decision to add the methods to the plugin?

    Yes, all this is in! :)


    So, we're ready to add the scan from picture feature (without file access though as this is not a scan plugin's role).
    For the raw B&W frame, we'd like to hear more to sense how widespread is the use :)

    Have fun with Unity!
     
  11. Hunkahunka

    Hunkahunka

    Joined:
    Jul 5, 2012
    Posts:
    7
    That would be great if you could add those two methods: processing from photo library and access to an array with black/white information. How quick can you add those two features after my purchase? If you need help defining the methods' interfaces, please don't hesitate to ask.
    Unfortunately I can't tell you more details for the general use cases in this public forum because I signed an NDA with my client. But be surprised what someone can do with QR codes when you're creative! I think it's a fantastic idea.
     
  12. TJBRB

    TJBRB

    Joined:
    Apr 13, 2012
    Posts:
    8
    I download it from the asset store, switched to iOS. Loaded "CodeScanner" scene.

    But "GameObject" has the error "The referenced script on this Behaviour is missing"

    I'm using Unity Pro 4.0.1f2.

    Hmmm, how do I fix this ?.
     
  13. C4MProdDev

    C4MProdDev

    Joined:
    Jul 9, 2009
    Posts:
    107
    @Hunkahunka Ok, we've decided to implement the two methods next week. So with the review time by Unity it'll be in the 1.3 sometimes two weeks from now. We'll contact you to validate the method interfaces and types sound smart to you.
     
  14. C4MProdDev

    C4MProdDev

    Joined:
    Jul 9, 2009
    Posts:
    107
    @tjbrb Please simply remove the component from the GameObject and relink it. The error probably comes from the import and that the script isn't at the same place in the demo than in your project.
     
  15. TJBRB

    TJBRB

    Joined:
    Apr 13, 2012
    Posts:
    8
    So I delete the GameObject then add the CodeScannerLauncher script. Complile and got this.

    Lastest XCode version

    Ld /Users/Admin/Library/Developer/Xcode/DerivedData/Unity-iPhone-gqkfwhirnbkinfddhfwcvlyyizpu/Build/Products/codescanner.app/codescanner normal armv7
    cd /Users/Admin/EasyScanner/scanner
    setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -L/Users/Admin/Library/Developer/Xcode/DerivedData/Unity-iPhone-gqkfwhirnbkinfddhfwcvlyyizpu/Build/Products -L/Users/Admin/EasyScanner/scanner -L/Users/Admin/EasyScanner/scanner/Libraries -F/Users/Admin/Library/Developer/Xcode/DerivedData/Unity-iPhone-gqkfwhirnbkinfddhfwcvlyyizpu/Build/Products -filelist /Users/Admin/Library/Developer/Xcode/DerivedData/Unity-iPhone-gqkfwhirnbkinfddhfwcvlyyizpu/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/codescanner.LinkFileList -dead_strip -weak_framework CoreMotion -weak-lSystem -fobjc-link-runtime -miphoneos-version-min=6.0 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework OpenAL -liconv.2 -liPhone-lib -framework AudioToolbox -framework CFNetwork -framework MediaPlayer -framework CoreLocation -framework SystemConfiguration -weak_framework iAd -framework CoreMedia -framework CoreVideo -weak_framework AVFoundation -framework CoreGraphics -weak_framework CoreMotion -weak_framework GameKit -o /Users/Admin/Library/Developer/Xcode/DerivedData/Unity-iPhone-gqkfwhirnbkinfddhfwcvlyyizpu/Build/Products/codescanner.app/codescanner

    Undefined symbols for architecture armv7:
    "_launchScannerImpl", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    ld: symbol(s) not found for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)


    "_launchScannerImpl", referenced from:


    RegisterMonoModules() in RegisterMonoModules.o


    ld: symbol(s) not found for architecture armv7


    clang: error: linker command failed with exit code 1 (use -v to see invocation)
     
  16. cmcwherter

    cmcwherter

    Joined:
    Feb 5, 2013
    Posts:
    1
    @fylen I am experiencing the same behavior described by TJBRB after having just acquired the tool from the asset store
     
  17. C4MProdDev

    C4MProdDev

    Joined:
    Jul 9, 2009
    Posts:
    107
    Ok, after looking into this, it seems the package uploaded is compromised. We have the fix ready, will test it tomorrow morning on our iOS and Android device range, and resubmit tomorrow.

    Sorry about this.
     
    Last edited: Feb 7, 2013
  18. C4MProdDev

    C4MProdDev

    Joined:
    Jul 9, 2009
    Posts:
    107
    @ TJBRB @cmcwherter : Yes, seems the last version of the plugin (v1.2) has the link between the GameObject and the Script broken. You don't need to delete the GameObject. Delete the prefab and the component of the GameObject and recreate the prefab and re-link the EasyCodeScanner script to the GameObject. This should fix the issue, we will release an update to fix it shortly.

    @TJBRB : The compilation errors are not related to the GameObject but just cannot find the plugin i think. make sure the Plugins folder is in root of Assets folder.
     
  19. Hunkahunka

    Hunkahunka

    Joined:
    Jul 5, 2012
    Posts:
    7
    @fylen: Are there any news on the update? How is your progress implementing the two new methods?
     
  20. C4M

    C4M

    Joined:
    Feb 7, 2013
    Posts:
    20
    @hunkahunka: sorry for the delay. Coder in charge got hold up with another project. We will submit the plugin update this week.

    The update will also include a method to better handle the cancel action (user not wanting to scan anything and coming back to the app).

    Thank you for your patience,
     
  21. RyanWang

    RyanWang

    Joined:
    Mar 6, 2013
    Posts:
    3
  22. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    Hi,

    Have you declared the 2 activities and permissions in the Manifest file? This is usually the reason of this behavior.

    Regards,

    Damien
     
  23. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @hunkahunka: The update has been submitted containing 2 methods for iOS : one to get the picture taken by the scanner (byte[] or Texture2D) and one to decode an image/Texture2D.
    It should be available in the next few days.

    Regards
     
    Last edited: Mar 8, 2013
  24. RyanWang

    RyanWang

    Joined:
    Mar 6, 2013
    Posts:
    3
    @Damien_C4M :

    Thanks a lot. But i still have problem.
    How to add android permussion ?? I open AndroidManifest.xml in EasyCodeScannerv1.3/Plugins/Android. I saw two permission has been add ...

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.VIBRATE"/>

    But it's nothing permission be required when install apk.

    I have searched in google, it show the permission will reflect by script.

    how should i do ???

    thanks. :D
     
  25. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    Alvaro Ulldemolins :

    Hi,

    Yes on EasyCodeScanner 1.3 and below, you need a GameObject named "CodeScannerBridge" assigned to the CodeScannerLauncher.cs script. On EasyCodeScanner 1.5, the GameObject is automatically created.

    About the undefined symbol, please make sure :

    1. On the unity3D side you have the plugin installed under "Plugin/iOS"
    2. In the generated iPhone project you have the EZCodeScannerViewController.mm file under the libraries folder
    3. The EZCodeScannerViewController.mm file has the Unity-iPhone Target Membership checked (on the right panel) - very important !

    Please report if you still have an issue.

    Regards
     
  26. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55

    Hi,

    If you also have the 2 activities declared and only one Manifest file, it should work. Could you post the Android logs (with ddms or aLogCat app) when you press the button, to know what's going on?

    Thanks
     
  27. aum

    aum

    Joined:
    Dec 17, 2012
    Posts:
    20
    I tried this, but don't works.
    I see that when I generate the xcode project Unity don't include the EZCodeScannerViewController.mm in the files of the project.

    $Captura de pantalla 2013-03-11 a la(s) 14.46.01.png

    Thanks in advance.

    Alvaro
     
  28. aum

    aum

    Joined:
    Dec 17, 2012
    Posts:
    20
    Hi,
    I got it to work by copying the .h in the Xcode project , and attaching the library in the Build Phases tab.

    Then, compile without errors.

    An option for automate this is create a PostProcess file in the Editor folder to automate this.... It's possbile that you forgiven this file in the plugin?

    EDITED:
    The only has to do is copy the plugin folder from "Assets/EasyCode folder/plugins/" to "Assets/plugins"
    and works. :)
     
    Last edited: Mar 11, 2013
  29. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55

    No, the project doesn't need to be copied manually in Xcode, Unity3D should do it by itself, all you need normally is to enable c++ exceptions and compile or armv7 in XCode, nothing more.

    Are you sure the iOS files are at the right place in your unity3D project? Seems they are at the wrong place and Unity3D don't copy them.

    $Screen Shot 2013-03-11 at 3.31.37 PM.png
     
  30. C4M

    C4M

    Joined:
    Feb 7, 2013
    Posts:
    20
    We're glad that it's working.
    In the the next release, we will update the readme to make it extra clear in which folder the plugin should be put. Thanks for your feedback.

    Would you agree to change, your comment on the plugin page on the asset store, or give it a good rating? Thanks in advance, good luck with your project,
     
  31. RyanWang

    RyanWang

    Joined:
    Mar 6, 2013
    Posts:
    3
    Hi,

    this link is my log (log after press the button)
    https://docs.google.com/document/d/1wByedjxfTuEu1WOCPK9L_906Qw_559s873u4Y7ODDZE/edit?usp=sharing

    And ... i got a new found.
    I build the android project and check AndroidManifest in my project folder (project\Temp\StagingArea).

    it doesn't appear permissions and easy code scanner's activities.

    it's my AndroidManifest ↓↓

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.TestCompany.TestProduct" android:versionName="1.0" android:versionCode="1">
    <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
    <application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false">
    <activity android:name="com.unity3d.player.UnityPlayerProxyActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="portrait">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="portrait">
    </activity>
    <activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="portrait">
    <meta-data android:name="android.app.lib_name" android:value="unity" />
    <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
    </activity>
    <activity android:name="com.unity3d.player.VideoPlayer" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="portrait">
    </activity>
    </application>
    <uses-feature android:glEsVersion="0x00020000" />
    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" />
    </manifest>
     
  32. Hunkahunka

    Hunkahunka

    Joined:
    Jul 5, 2012
    Posts:
    7
    Thanks for the implementation of the 2 new methods! Unfortunately they seem to be iOS-only. Is it possible to support Android too?
     
  33. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @RyanWang :

    Thanks for le Log file and your manifest.

    So it is not using the EasyCodeScanner manifest file but the one generated by Unity. Are you sure the EasyCodeScanner plugin is at the root of the Plugins/Android folder?

    -> You should have the Manifest of the EasyCodeScanner plugin located at Plugins/Android/Manifest.xml

    $Screen Shot 2013-03-18 at 11.11.54 AM.png
     
  34. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @Hunkahunka :

    It is a bit more complicated on Android since it goes through more layers (jni/java/Android) and may take a some time. By the way, we will try to provide you the functionality on Android as soon as possible in the next releases.
     
  35. WolfandVoid

    WolfandVoid

    Joined:
    Feb 20, 2013
    Posts:
    6
    Hey, I had a chat with Mathieu via email and he requested I post my questions here. Since most of that is fixed or already addressed in this thread I'll just post the one.

    I was wondering what the best approach to changing the visuals is? We're using the scanner in a game and would like to have at least a custom background to go with the game's theme. I haven't had look at the source code too much as for our alpha version of the game just required the game to receive the barcode and process the information.

    EDIT: We just stumbled upon a little problem. Just installed v1.5 and after returning to the game after scanning a code, the game crashes. This occurs when the seeker / green box bounces around a few times before settling something to scan. It seems like it only occurs when the phone vibrates twice. It then returns to our game, half a second later it shuts down the game. It does this on an iPhone 5, the iPhone 4 doesn't quite seem quick enough.

    Cheers Phil
     
    Last edited: Mar 19, 2013
  36. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @devPhil : Thanks for your feedback!

    Visual
    About changing the visual, the plugin currently draws the interface thanks to internal drawRects without any external assets (both Android iPhone). We haven't found yet a proper way to load an external PNG file in the EasyCodeScanner plugin since a Unity plugin doesn't have access to the Unity project resource files (JNI / external package).
    Anyway, it is still possible to display backgrounds or images in the scanner by converting the image data into an int array, embedding them in the code (in a Data class for instance) and then load the image directly from the code.

    For instance on Android:

    public static final int[] img1 = { 0, 0, 0, 50331647, 83886079, 134217727, 201326591, 251658239, 318767103,....218103807, 134217727, 83886079, 33554431, 0, 0, 0];

    Bitmap bitmap = Bitmap.createBitmap(Data.img1, width, height, Bitmap.Config.ARGB_8888);
    ImageView mImage = new ImageView(this);
    mImage.setImageBitmap(bitmap);



    Crash
    If it vibrates twice it means that it has decoded 2 frames successfully (certainly due to the fact that the iPhone5 is fast) and then certainly calls the callback twice. We already experience this behavior but it never crashed the app when returning from the scanner.
    We are investigating at our side why 2 scans could happen and checking if it may cause a crash.

    Regards
     
    Last edited: Mar 19, 2013
  37. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @devPhil :

    From the source code point of view it could happen only on iOS and seems that the double scan occurs when there is 2 barcodes on the same picture. As a quick fix for the v1.5 (but will be fix in 1.6) you can add a break in the if statement of the Assets/Plugins/iOS/EZCodeScannerViewController.mm line 72 as follow:

    for (s in symbols)
    {
    UnitySendMessage("CodeScannerBridge", "onScannerMessage", [s.data cStringUsingEncoding:NSUTF8StringEncoding]);
    break;
    //UIImageView* view = (UIImageView*)[self.view viewWithTag:2];
    //view.image = [UIImage imageWithData:pixelData];
    //view.hidden = NO;
    //mLabel.text = s.data;
    }


    Tell me if it works better. Make also sure on your side you don't have a code that releases an object when the scan is done that could break the code (the second time trying to access a desallocated object).
     
  38. WolfandVoid

    WolfandVoid

    Joined:
    Feb 20, 2013
    Posts:
    6
    @Damien_C4M:

    Thanks for the quick reply. We've experience double scans ni previous versions without any problems, it just happened with v1.5. I tried the break but it still scanned twice and crashed. Just to try it out I put the break before the UnitySendMessage function and to my surprise, it still crashed. It still crashes when it comes back to the game after half a second or so. I made sure to disable the code executed from the scan just to make sure it wasn't anything on our side.

    Just wanted to say that we're grateful for the work you're putting in and the quick and helpful responses we're getting, keep up the good work!
     
  39. aum

    aum

    Joined:
    Dec 17, 2012
    Posts:
    20
    Hi, how can I change the Scan GUI, not the example.
    The GUI that appear the Cancel button and the "Scanning..." text.

    Thanks

    Alvaro
     
  40. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @devPhil : Do you have a log file from XCode or Unity3D that could help? I actually cannot reproduce it. Which version of Unity are you using? OS version of the iPhone?
    Thanks
     
  41. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @aum : In the "LaunchScanner" call you can specify the text to display (instead of "scanning..") and about the cancel button you can modify the line 29 of EZCodeScannerViewController.mm under the iOS folder.
     
  42. fixitchris

    fixitchris

    Joined:
    Mar 16, 2011
    Posts:
    21
    Thanks for the great product!

    Can you confirm that left-hand or right-hand landscape locked on iPad works? I am passing forceLandscape=true, but the imager comes up as portrait.

    -chris
     
  43. fixitchris

    fixitchris

    Joined:
    Mar 16, 2011
    Posts:
    21
    Also I am noticing that my app crashes when multiple QR barcodes are visible.

    OSX 10.7, Unity 4.1, iPad2 6.1.3, EZ 1.5

    $Screen Shot 2013-03-28 at 2.45.15 PM.png
     
    Last edited: Mar 28, 2013
  44. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @fixitchris : Seems to be the same error as devPhil encountered when scanning multiple codes. We could not reproduce it here with an iPhone 4 but seems you managed to track it down.
    We were suspecting the lack of break in the if statement of the Assets/Plugins/iOS/EZCodeScannerViewController.mm line 72 as follow:

    Code (csharp):
    1. for (s in symbols)
    2. {
    3. UnitySendMessage("CodeScannerBridge", "onScannerMessage", [s.data cStringUsingEncoding:NSUTF8StringEncoding]);
    4. break;
    5. //UIImageView* view = (UIImageView*)[self.view viewWithTag:2];
    6. //view.image = [UIImage imageWithDataixelData];
    7. //view.hidden = NO;
    8. //mLabel.text = s.data;
    9. }
    But seems to be something else when looking at your screenshot. We will investigate on an iPad and see if the scanner is not over released
     
  45. fixitchris

    fixitchris

    Joined:
    Mar 16, 2011
    Posts:
    21
    Last edited: Apr 1, 2013
  46. fixitchris

    fixitchris

    Joined:
    Mar 16, 2011
    Posts:
    21
    re: multiple barcode scanning crash

    The break statement won't fix it. Looking at the debug output, I see two messages 'pixelData length=xxxxx' where the length for each is different. So it is definitely trying to scan one after another, however you're calling quit() after the first scan. Maybe preventing a second entry into readerView() will fix it, since the mReader/mScanner is released after the first barcode scanned?
     
    Last edited: Apr 1, 2013
  47. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @fixitchris : Yes the issue is due to the 2 successives calls to quit. A fixed version 1.6 is ready to be rolled out. Ive cancelled the double calls to the selector.
     
  48. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
  49. Haptix Games

    Haptix Games

    Joined:
    Aug 8, 2012
    Posts:
    29
    Also, could you default the xcode navigation bar with the cancel to the bottom of the screen? Any way you hold an ipad, you are asking users to take their hands off and reach to the top of the screen, whereas if it were at the bottom it is a simple thumb away.
     
  50. fixitchris

    fixitchris

    Joined:
    Mar 16, 2011
    Posts:
    21
    re: multiple scan crash

    Thanks for finding the bug.

    re: multiple scans in general

    The for(s in symbols) loop doesn't make much sense. I'm not sure what condition must be met for multiple barcodes to be decoded but sending more than one back to Unity would be awkward. If UnitySendMessage: onScannerMessage would be called multiple times right after another then I wouldn't be sure which message I should act on in my Unity project.

    re: landscape mode

    We played around a bit with the UIViewController and UINavigationController, the shouldAutorotateToInterfaceOrientation does seem to work, but only if I assign navController to keyWindow.rootViewController. However, even then things are not quite right. Will this be able to make it into 1.6? If you need testing then send the code my way.