IOS中的pdf417条形码扫描仪无法正常工作

时间:2014-12-19 14:13:27

标签: ios cordova barcode-scanner pdf417

我正在开发phonegap中的pdf417条码扫描器。我在android手机上测试过。它的工作就像一个魅力,但当我在IOS中测试它时,我没有收到任何错误,但没有在IOS中调用pdf417scanner。我添加了CDVpdf417.h,CDVpdf417.m插件并添加了<plugin name="CDVpdf417" value="CDVpdf417" />

config.xml中:

     <feature name="Pdf417Scanner">
            <param name="ios-package" value="CDVpdf417" />
        </feature> .

index.js:

scanButton.addEventListener('click', function() {

            var scanner = cordova.require("cordova/plugin/Pdf417Scanner");

            //cordova.plugins.pdf417Scanner.scan(
            scanner.scan(
                // Register the callback handler
                function callback(data) {

                    alert("got result " + data.data + " type " + data.type);

                    if (data.cancelled == true) {
                        resultDiv.innerHTML = "Cancelled!";
                    } else if (data.resultList && data.resultList.length > 1) {
                        // More than 1 element in results
                        resultDiv.innerHTML = data.resultList.length + " results";
                    } else {



                        resultDiv.innerHTML = "Data: " + data.data + " (raw: " + hex2a(data.raw) + ") (Type: " + data.type + ")";
                    }
                },

                // Register the errorHandler
                function errorHandler(err) {
                    alert('Error');
                },

                [ ["PDF417", "QR Code"], true ] //We want qr codes and pdf417 scanned with the beep sound on
            );
        });
你能告诉我这里我做错了吗?

0 个答案:

没有答案