Upgrading from Capacitor v2 in 2024

RMAG news

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

This intro
Start of the migration
Files
Camera, Reviews and Biometrics (coming soon)
OneSignal (coming soon)
Lessons Learned (coming soon)

Leave a Reply

Your email address will not be published. Required fields are marked *