Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

success-function returns nothing #340

Open
infoforum opened this issue Oct 12, 2016 · 0 comments
Open

success-function returns nothing #340

infoforum opened this issue Oct 12, 2016 · 0 comments

Comments

@infoforum
Copy link

infoforum commented Oct 12, 2016

Hello. Sorry for my English )
I added the plugin BarcodeScanner in my Phonegap-application.

  1. Added to config.xml:
    <plugin name="com.phonegap.plugins.barcodescanner" spec="2.0.0" source="pgb" />
    and
    <preference name="android-build-tool" value="gradle" />
  2. In the javascript:
cordova.plugins.barcodeScanner.scan(
      function (result) {
          alert("We got a barcode\n" +
                "Result: " + result.text + "\n" +
                "Format: " + result.format + "\n" +
                "Cancelled: " + result.cancelled);
      }, 
      function (error) {
          alert("Scanning failed: " + error);
      }
   );
  1. The finished application I created through the site build.phonegap.com

Should I do anything else?
The scanner is triggered and even scans, that's just not give any value.
When I press the Cancel button on the scanner, the application falls (closed).
System log on the iPhone 5 contains the following entries after the scan:

Oct 11 20:18:49 iPhone MyApp[4669] <Warning>: WARNING: -[<AVCaptureVideoPreviewLayer: 0x15de5610> isOrientationSupported] is deprecated.  Please use AVCaptureConnection's -isVideoOrientationSupported
Oct 11 20:18:49 iPhone MyApp[4669] <Warning>: WARNING: -[<AVCaptureVideoPreviewLayer: 0x15de5610> setOrientation:] is deprecated.  Please use AVCaptureConnection's -setVideoOrientation:
Oct 11 20:18:49 iPhone MyApp[4669] <Warning>: WARNING: -[<AVCaptureVideoPreviewLayer: 0x15de5610> setOrientation:] is deprecated.  Please use AVCaptureConnection's -setVideoOrientation:
Oct 11 20:18:58 iPhone kernel[0] <Notice>: AppleH4CamIn::ISP_FlushInactiveDARTMappings: 0x00000000
Oct 11 20:18:58 iPhone MyApp[4669] <Error>: -[CDVPluginResult toSuccessCallbackString:]: unrecognized selector sent to instance 0x15d28ad0

Please tell me what is wrong?

Do I have to include the file: <script type = "text/javascript" src = "barcodescanner.js"></ script> in my index.html?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant