# Migrating from 1.0

#### Migrating from com.batch.cordova 1.x

Batch's cordova plugin 2.0.0 update being a major version, it brings some breaking change to existing implementations:

* batch.push.setGCMSenderId() has been *removed*. Android now uses FCM, which requires you to add a `google-services.json` file to your project. [More info here](/developer/sdk/cordova/sdk-integration.md#android-setup).
* "setCanUseAndroidID" has been *removed* from the config object. You can safely leave the key, but it will be ignored.

For any other supported API use cases, your code requires no change.

#### Migrating from batch.userProfile

If you've previously used `batch.userProfile`, you can easily use Batch User. You will still be able to set a custom region, language or identifier with the new API.

The main difference between Batch User and `BatchUserProfile` is that you'll now be required to use an editor object in order to make changes, and then save them. This transactional behaviour brings additional thread-safety and better performance.

That way, what used to be:

```javascript
// Use the user profile to set custom language and data 
batch.userProfile.setLanguage("en"); // Language must be 2 chars, lowercase, ISO 639 formatted
batch.userProfile.setRegion("US"); // Region must be 2 chars, uppercase, ISO 3166 formatted
batch.userProfile.setCustomID("john.doe");
```

will become this:

```java
batch.user.getEditor()
    .setLanguage("en") // Language must be 2 chars, lowercase, ISO 639 formatted
    .setRegion("US") // Region must be 2 chars, uppercase, ISO 3166 formatted
    .setIdentifier("john.doe")
    .save(); // Don't forget to save the changes!
```

{% hint style="info" %}
`batch.userProfile` is now deprecated, but will continue to work. We still suggest you migrate in the near future, so you can take advantage of the new capabilities.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
