/**
 */
package com.cocodin.barcodescan.plugin;

import android.util.Log;

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView;
import org.json.JSONArray;

public class BarcodeScanChainway extends CordovaPlugin {

  private static final String TAG = "BarcodeScan";

  public void initialize(CordovaInterface cordova, CordovaWebView webView) {
    super.initialize(cordova, webView);
    Log.d(TAG, "Initializing BarcodeScan Plugin");
  }

  public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) {
    Log.d(TAG, "execute: " + action);
    if (action.equalsIgnoreCase("scan")) {
      PluginHelper.scan(cordova, webView, args, callbackContext);
    }
    return true;
  }

}
