There is a PhoneGap mobile application in which you intend to use a QR code scanner. I use the plugin: BarcodeScanner , I do everything according to the instructions:
Added in config.xml:
<plugin name="com.phonegap.plugins.barcodescanner" spec="2.0.0" source="pgb" /> Well, actually js-code scan:
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); } ); As a result, when this code is called, the camera window really opens, the QR code is scanned, well, then nothing happens, that is, after scanning no alerts.
I conduct tests on iPhone5, in its system log about my application the following is written:
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 What's wrong? Where to dig?
toSuccessCallbackStringfunction. Either this is a delegate method and you need to write it, or if this is a library method, apparently some part of it is not connected - Max Mikheyenko