I'd like to share a bit of my experience: I have been building projects with Construct 3 using Capacitor and Framework7 since 2023. If anyone is interested in experimenting with this setup, I plan to create some brief documentation.
Compatibility and Configuration
All Cordova plugins are fully functional in Capacitor. However, it's important to note that Capacitor does not support variables in plugin.xml. You can manipulate these Cordova variables using hooks/scripts instead.
Capacitor also replaces config.xml with capacitor.config.json. My workflow is as follows:
- Export the project from Construct 3 as a Cordova project.
- Use a hook/script to port the package.json configuration into capacitor.config.json.
For example, the script would take this data from your Cordova project and automatically generate a capacitor.config.json file like the one below:
{
"appId": "io.cordova.hellocordova",
"appName": "HelloCordova",
"webDir": "www",
"bundledWebRuntime": false,
"plugins": {
"AdMob": {
"APP_ID_ANDROID": "ca-app-pub-3940256099942544~3347511713",
"APP_ID_IOS": "ca-app-pub-3940256099942544~1458002511"
}
}
}
Additionally, the icon URI paths are different in Cordova and Capacitor, so the hook/script must be designed to handle this automatically.
Differences in Plugin Installation
The way you install plugins is also different. For example:
- Cordova: cordova plugin add plugin-name
- Capacitor: npm i plugin-name
For simple projects, the difference between Cordova and Capacitor might not be very noticeable. However, on larger projects, the difference is quite significant. I personally prefer Capacitor because its code is based on JavaScript modules, which feels more modern and structured. It took me over a month to get used to the Capacitor workflow, but the results have been well worth it.