What is the difference between capasitor plugins & ionic native pluginss

A little history recap will probably make this clearer.

The entire universe of hybrid mobile app development as we know it today dates back to a product called PhoneGap. Adobe bought some little company that had developed the technology. Eventually it was open-sourced under the name Cordova, and at that point Ionic entered the scene.

The most important part of Cordova for this discussion is a message broker that is capable of passing messages back and forth across a bridge. On one side of the bridge sits a JavaScript ecosystem where your app code lives. It runs in a web browser. Cordova “plugins” present a unified API on the JavaScript side of the bridge. On the other side of the bridge, there is native code that is different for each supported target OS.

At this point in time, asynchronous programming in JavaScript was in flux. There wasn’t really an accepted standard for Promise, much less common acceptance of RxJS and its Observables. However, something like a Promise was conceptually a perfect fit for something like Cordova, where the base interaction really does consist of throwing a bottle in the proverbial ocean and waiting for somebody to toss one back.

Enter the Ionic Native project. Its purpose was to wrap Cordova plugins into a more friendly API that delivered Promises instead of utilizing (often inconsistent) callback interfaces.

Time passes.

The folks at Ionic decided that there was only so far that they could go with Cordova, and they thought they could deliver a “better Cordova”. That project became Capacitor. At its core, Capacitor has the same message broker functionality, although the bridge implementation itself is different. Capacitor also strove to decouple the runtime architecture from the build-time functionality, choosing to leverage more heavily third-party tools like Android Studio and XCode. Cordova tried to do all the cross-platform building itself as well, which made arguably much more sense at the time the choice was made than it does today.

So, addressing your questions in reverse order,

#3: Yes, it’s OK to mix.
#2: If you can find a Capacitor plugin that does what you want, prioritize that, if only because it’s much more likely to be supported going forward. If you can’t find a Capacitor plugin, and there is an @ionic-native alternative, try that. If all you have is a Cordova plugin with no Ionic Native shim, it’s extremely likely that the Cordova plugin you have found is rusty and likely full of bugs. Your best bet would probably be to try to write a Capacitor-friendly replacement (or pay somebody to do that).
#1. Capacitor plugins are newer, as described in the history recap above. Ionic Native is syntax sugar on the JavaScript side of the bridge for Cordova plugins. Generally speaking, Capacitor is capable of talking to the native side of Cordova plugins. There are exceptions. Known incompatible Cordova plugins are listed here.

3 Likes