Default plugins - what are they used for?

The application starters include several plugins by default via the ionic2-app-base: https://github.com/driftyco/ionic2-app-base/blob/master/config.xml

The list of plugins:

  • ionic-plugin-keyboard
  • cordova-plugin-whitelist
  • cordova-plugin-console
  • cordova-plugin-statusbar
  • cordova-plugin-device
  • cordova-plugin-splashscreen

What are they used for?
(And where in the code can I find this?)
Are they really required?

To answer part of my own question:

platform.ready().then(() => {
  // Okay, so the platform is ready and our plugins are available.
  // Here you can do any higher level native things you might need.
  statusBar.styleDefault();
  splashScreen.hide();
});

This is in app.components.ts.

So we are down to this list now:

  • ionic-plugin-keyboard
  • cordova-plugin-whitelist
  • cordova-plugin-console
  • cordova-plugin-statusbar
  • cordova-plugin-device
  • cordova-plugin-splashscreen

whitelist is to allow external resources on Android
console allows for logging (and should be removed before production)
device allows for information about the device
keyboard provides better event messaging on show/hide of the keyboard

Those and 100s more plugin can be found at: https://cordova.apache.org/plugins/#/ or at npmjs.org with documentation, source code, and more.

1 Like

Thanks, the general use of these plugins were clear to me before, sorry if this wasn’t clear.
I was trying to find out if they are actually used in the starter templates and where.

The console plugin should be removed, right. I actually asked why this is back when Ionic 1 was still current: Why should the console plugin be removed for a release build of the app?

I also see that the default config.xml contains these, using the functionality from the whitelist plugin:

<allow-navigation href="http://ionic.local/*"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
<platform name="android">
  <allow-intent href="market:*"/>
[...]
<platform name="ios">
  <allow-intent href="itms:*"/>
  <allow-intent href="itms-apps:*"/>
[...]

So we are down to this:

  • ionic-plugin-keyboard
  • cordova-plugin-whitelist
  • cordova-plugin-console
  • cordova-plugin-statusbar
  • cordova-plugin-device
  • cordova-plugin-splashscreen