Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/109.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用phonegap为iPhone编译条形码扫描仪?_Iphone_Ios_Cordova_Barcode_Barcode Scanner - Fatal编程技术网

如何使用phonegap为iPhone编译条形码扫描仪?

如何使用phonegap为iPhone编译条形码扫描仪?,iphone,ios,cordova,barcode,barcode-scanner,Iphone,Ios,Cordova,Barcode,Barcode Scanner,我目前正在为我最后一年的项目编写一个使用条形码扫描仪的应用程序 在互联网上搜索之后,我来到了这个网站: 我的第一个问题是,我应该使用哪种代码?iOS/BarcodeScanner中的那个,还是iPhone/BarcodeScanner中的那个?我两个都试过了,但我只想有人给我一个明确的答案。这引出了我的第二个问题 我的第二个问题是,在使用iOS/BarcodeScanner中的代码时,我的应用程序编译得很好,但相机扫描拒绝显示。如何通过index.html调用扫描函数 如果我应该使用iPhone

我目前正在为我最后一年的项目编写一个使用条形码扫描仪的应用程序

在互联网上搜索之后,我来到了这个网站:

我的第一个问题是,我应该使用哪种代码?iOS/BarcodeScanner中的那个,还是iPhone/BarcodeScanner中的那个?我两个都试过了,但我只想有人给我一个明确的答案。这引出了我的第二个问题

我的第二个问题是,在使用iOS/BarcodeScanner中的代码时,我的应用程序编译得很好,但相机扫描拒绝显示。如何通过index.html调用扫描函数

如果我应该使用iPhone/BarcodeScanner中的代码,编译它们会给我一个“PGPlugin.h file missing”错误。我如何着手修理它


我对整个编程领域还是新手,也做过谷歌搜索,所以如果我问了一个已经回答过的问题,请原谅我。提前谢谢你的帮助

您好,请检查第一个问题的答案,然后按照自述进行操作

对第二个问题的答复:

window.plugins.barcodeScanner.scan(
function(result) {
    if (result.cancelled)
        alert("the user cancelled the scan")
    else
        alert("we got a barcode: " + result.text)
},
function(error) {
    alert("scanning failed: " + error)
}
)

以上环节解决了所有问题