DEV Community

Cover image for Upgrading from Capacitor v2 in 2024
Gerhard for Reconcept

Posted on

Upgrading from Capacitor v2 in 2024

This is the story of how we moved our Ionic app from Cordova + Capacitor 2/3 to the latest Capacitor 5 + Capacitor plugins.

First some background

We have a simplified version of our web application available on mobile through the App Stores, which allows our users to quickly add to their portfolio.

The app is built in Ionic, using a mix of Cordova and Capacitor plugins to communicate with the native systems. To name a few systems that we use:
Filesystem to handle file interactions like selecting, uploading and viewing.
Camera plugin is used to set a profile picture
Biometric features of the phone to quickly unlock the app and validate documents.

Furthermore we send notifications using OneSignal, and need to listen for these in the background while the app is not running.

Why not upgrade sooner?

The Cordova plugins have always worked, and we never really required more features from the phones so the plugins were not kept up to date. It was on our radar, but it never had enough priority to do something about. If it ain’t broken, don’t fix it, right?

Then the unthinkable happened, we wanted to build a new feature using something native: a badge on the app icon showing actionable items for the user. We quickly found a plugin that could provide this feature, but it was built for the latest Capacitor version, while we were almost 3 major versions behind.

This gave us the incentive to update the used Capacitor version to the latest and replace the plugins from Cordova with their new Capacitor counterparts.

In this multipart series, we’ll go into our experiences while upgrading the app from ancient history to modern times.

Parts

  1. This intro
  2. Start of the migration
  3. Files
  4. OneSignal
  5. Camera, Reviews and Biometrics
  6. Lessons Learned

Top comments (0)