如何使用Cordova的card.io插件在adroid设备中隐藏PayPal徽标

如何使用Cordova的card.io插件在adroid设备中隐藏PayPal徽标,cordova,ionic-framework,cordova-plugins,ionic4,card.io,Cordova,Ionic Framework,Cordova Plugins,Ionic4,Card.io,根据插件文档,似乎没有一个配置选项可以在卡片细节操作栏中隐藏PayPal徽标。但是,android的card.io SDK有一个选项: 有办法隐藏此徽标吗?是的,有办法 首先,您必须删除android平台才能从头下载所有依赖项: ionic cordova platform remove Android 然后,添加card.io cordova插件: ionic cordova plugin add card.io.cordova.mobilesdk taht之后,在plugins/card

根据插件文档,似乎没有一个配置选项可以在卡片细节操作栏中隐藏PayPal徽标。但是,android的card.io SDK有一个选项:

有办法隐藏此徽标吗?

是的,有办法

首先,您必须删除android平台才能从头下载所有依赖项:

ionic cordova platform remove Android
然后,添加card.io cordova插件:

ionic cordova plugin add card.io.cordova.mobilesdk
taht之后,在plugins/card.io.cordova.mobilesdk/src/android中,您必须在2个文件中进行更改:

格雷德尔先生 替换

据此:

dependencies {
  compile 'io.card:android-sdk:5.5.1'
}
在文件CardIOCordovaPlugin.java中,您必须添加新的配置选项EXTRA\u USE\u PAYPAL\u ACTIONBAR\u图标:

  private void scan(JSONArray args) throws JSONException {
        Intent scanIntent = new Intent(this.activity, CardIOActivity.class);
        JSONObject configurations = args.getJSONObject(0);
        // customize these values to suit your needs.
        scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, this.getConfiguration(configurations, "requireExpiry", false)); // default: false
        scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CVV, this.getConfiguration(configurations, "requireCVV", false)); // default: false
        scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_POSTAL_CODE, this.getConfiguration(configurations, "requirePostalCode", false)); // default: false
        scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_MANUAL_ENTRY, this.getConfiguration(configurations, "suppressManual", false)); // default: false
        scanIntent.putExtra(CardIOActivity.EXTRA_RESTRICT_POSTAL_CODE_TO_NUMERIC_ONLY, this.getConfiguration(configurations, "restrictPostalCodeToNumericOnly", false)); // default: false
        scanIntent.putExtra(CardIOActivity.EXTRA_KEEP_APPLICATION_THEME, this.getConfiguration(configurations, "keepApplicationTheme", false)); // default: false
        scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CARDHOLDER_NAME, this.getConfiguration(configurations, "requireCardholderName", false)); // default: false
        scanIntent.putExtra(CardIOActivity.EXTRA_USE_CARDIO_LOGO, this.getConfiguration(configurations, "useCardIOLogo", false)); // default: false
        scanIntent.putExtra(CardIOActivity.EXTRA_SCAN_INSTRUCTIONS, this.getConfiguration(configurations, "scanInstructions", false)); // default: false
        scanIntent.putExtra(CardIOActivity.EXTRA_NO_CAMERA, this.getConfiguration(configurations, "noCamera", false)); // default: false
        scanIntent.putExtra(CardIOActivity.EXTRA_SCAN_EXPIRY, this.getConfiguration(configurations, "scanExpiry", false)); // default: false
        scanIntent.putExtra(CardIOActivity.EXTRA_LANGUAGE_OR_LOCALE, this.getConfiguration(configurations, "languageOrLocale", false)); // default: false
        scanIntent.putExtra(CardIOActivity.EXTRA_GUIDE_COLOR, this.getConfiguration(configurations, "guideColor", false)); // default: false
        scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_CONFIRMATION, this.getConfiguration(configurations, "suppressConfirmation", false)); // default: false
        scanIntent.putExtra(CardIOActivity.EXTRA_HIDE_CARDIO_LOGO, this.getConfiguration(configurations, "hideCardIOLogo", false)); // default: false
        scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_SCAN, this.getConfiguration(configurations, "suppressScan", false)); // default: false
        scanIntent.putExtra(CardIOActivity.EXTRA_USE_PAYPAL_ACTIONBAR_ICON, false); // THIS IS THE NEW OPTION
        this.cordova.startActivityForResult(this, scanIntent, REQUEST_CARD_SCAN);
    }
在本例中,我将这个新选项硬编码为false,但是您可以实现getConfiguration方法从您的页面设置这个选项

完成这两项更改后,请再次将android平台添加到项目中,以下载最新的SDK v5.5.1:

ionic cordova platfrom add android
就这些,贝宝的标志已经消失了

ionic cordova platfrom add android