> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-sdk-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Migration and Precedence

### Android Migration Steps

1. **Add Configuration File:** Place the `moengage.xml` file in `src/main/res/values/moengage.xml`.
2. **Update Application Class:** Remove manual `MoEngage.Builder` logic and replace it with `initializeDefaultInstance`.

<Tabs>
  <Tab title="Java">
    ```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
    import com.moengage.react.MoEInitializer;
    MoEInitializer.INSTANCE.initializeDefaultInstance(this);
    ```
  </Tab>

  <Tab title="Kotlin">
    ```kotlin theme={"theme":{"light":"github-light","dark":"github-dark"}}
    import com.moengage.react.MoEInitializer
    MoEInitializer.initializeDefaultInstance(application)
    ```
  </Tab>
</Tabs>

### iOS Migration Steps

1. **Update Info.plist**: Add WorkspaceId, DataCenter, etc., directly to your `Info.plist` file.
2. **Update AppDelegate**: Remove manual `MoEngageSDKConfig` logic and call `initializeDefaultInstance`.

<Tabs>
  <Tab title="Objective-C">
    ```objectivec theme={"theme":{"light":"github-light","dark":"github-dark"}}
    #import <MoEngageSDK/MoEngageSDK.h>
    [[MoEngageInitializer sharedInstance] initializeDefaultInstanceWithAdditionalReactConfig:[[MoEngageReactSDKDefaultInitializationConfig alloc] init]];
    ```
  </Tab>

  <Tab title="Swift">
    ```swift theme={"theme":{"light":"github-light","dark":"github-dark"}}
    import MoEngageSDK
    MoEngage.sharedInstance.initializeDefaultInstance()
    ```
  </Tab>
</Tabs>

### Precedence Rules

The source of configuration is determined by the initialization function called in your native code:

* **Android**:
  * **File-Based Init:** `initializeDefaultInstance(context)` reads `moengage.xml`.
  * **Code-Based Init:** `initialize(context, moEngage.Builder)` uses the configuration object and ignores XML.
* **iOS:** Auto-initialization via `Info.plist` occurs first. Calling the manual `initialize` method with a configuration object later will update the current instance.
