Migrating from 2.3
Batch Cordova Plugin 4.0 is a major release, which introduces breaking changes from 2.x. This guide describes how to update the plugin in an application already using Batch Cordova Plugin 2.3.
Cordova and Ionic (CLI, android/iOS plugins) version requirements are higher than 2.3. Please see SDK Integration for the updated requirements.
Support for iOS 8 and 9 has been dropped.
As of version 3.0, the plugin has moved under the
batch npm group. It is now named
@batch.com/cordova-plugin. With 4.0, the Plugin ID has been updated to match the NPM package name.
In order to update to 4.0, remove the old plugin and add the new one. The old plugin will stay published at version 2.3.
cordova plugin remove com.batch.cordova cordova plugin add @batch.com/cordova-plugin
Batch Cordova Plugin 4.0 requires androidx to be enabled in your project.
See the SDK Integration documentation for more info.
Version 2.x of the plugin came with automatic Firebase integration, which consisted of:
- An explicit Android dependency
- A Cordova hook to copy required data from
This caused a lot of incompatibilities with the different Firebase plugins used in the Cordova ecosystem, so we removed this.
On Android, Batch Cordova Plugin 4.0 needs Firebase Cloud Messaging to be added using the third party plugin: see the SDK Integration documentation for more info.
The explicit dependency on
androidx.appcompat has also been removed to reduce version mismatch problems: while it is still required to be able to display Mobile Landings and In-App Campaigns, this dependency should be automatically added by Firebase.
Note: Batch doesn't require Firebase Cloud Messaging on iOS. You can safely install an Android-only plugin.
This change should be transparent, but might require cleaning the project: on iOS, Batch's native framework isn't shipped with the plugin anymore but is fetched using Cocoapods.