> For the complete documentation index, see [llms.txt](https://doc.batch.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.batch.com/developer/sdk/cordova/migrations/2x-migration.md). Agents can also search and read this documentation through its [MCP server](https://doc.batch.com/~gitbook/mcp).

# 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.

### Minimum Cordova version

Cordova and Ionic (CLI, android/iOS plugins) version requirements are higher than 2.3. Please see [SDK Integration](https://doc.batch.com/developer/sdk/cordova/sdk-integration.md) for the updated requirements.

Support for iOS 8 and 9 has been dropped.

### Plugin Name

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.

```shell
cordova plugin remove com.batch.cordova
cordova plugin add @batch.com/cordova-plugin
```

### Androidx

Batch Cordova Plugin 4.0 requires androidx to be enabled in your project.

See the [SDK Integration documentation](https://doc.batch.com/developer/sdk/cordova/sdk-integration.md#android-setup) for more info.

### Firebase Cloud Messaging

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 `google-services.json`

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](https://doc.batch.com/developer/sdk/cordova/sdk-integration.md#android-setup) 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.

{% hint style="info" %}
Batch doesn't require Firebase Cloud Messaging on iOS. You can safely install an Android-only plugin.
{% endhint %}

### iOS Framework integration

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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.batch.com/developer/sdk/cordova/migrations/2x-migration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
