Uniting our global community of Ionic developers and contributors. May 25, 2022.
When developing an app that uses Capacitor, it’s possible to use both Cordova and Ionic Native plugins.
Simply install your plugin of choice, sync your project, finish any required native project configuration, and you’re ready to go:
npm install cordova-plugin-name npx cap sync
Similar to the installation steps. Simply update the cordova plugin to the latest version then Capacitor will pick up the changes:
npm install [email protected] npx cap update
If you don’t want to risk to introduce breaking changes, use
npm update cordova-plugin-name instead of
update respects semver.
npm install @ionic-native/[email protected] npm install [email protected] npx cap update
See the list of Capacitor and Cordova plugins (and their exact version numbers) installed in your project with:
npx cap ls
Capacitor does not support Cordova install variables, auto configuration, or hooks, due to our philosophy of letting you control your native project source code (meaning things like hooks are unnecessary). If your plugin requires variables or settings to be set, you’ll need to apply those configuration settings manually by mapping between the plugin’s
plugin.xml and required settings on iOS and Android.
Some Cordova plugins don’t work with Capacitor or Capacitor provides a conflicting alternative. See here for details and a known incompatibility list.