Commit b8949703 by Oscar Fuentes

Fix call function

parent 46d02143
......@@ -23,15 +23,15 @@ public class BarcodeScanChainway extends CordovaPlugin {
public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) {
PluginHelper.init(cordova);
Log.d(TAG, "execute: " + action);
try{
try {
String device = args.get(0).toString();
if (action.equalsIgnoreCase("scan") && device.equalsIgnoreCase("scanner") {
if (action.equalsIgnoreCase("scan") && device.equalsIgnoreCase("scanner")) {
PluginHelper.scan(cordova, webView, args, callbackContext);
}else if(action.equalsIgnoreCase("scan") && device.equalsIgnoreCase("movile") {
} else if (action.equalsIgnoreCase("scan") && device.equalsIgnoreCase("movile")) {
BarcodeScanner barcodeScanner = new BarcodeScanner();
barcodeScanner.scan(args);
}
}catch(JSONException e){
} catch (JSONException e) {
e.printStackTrace();
}
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment