cordova-moengage-core 11.0.0 and requires cordova-ios 8. On cordova-ios 8 and later, the MoEngage plugin installs through SPM. On cordova-ios 7 and earlier, it continues to install through CocoaPods, so the migration is the upgrade to cordova-ios 8.
The steps in this guide cover the MoEngage-specific tasks: the AppDelegate initialization, the push notification extension targets, and your build scripts. For the Cordova-specific upgrade steps and breaking changes, refer to the cordova-ios 8.0.0 release announcement in the Cordova documentation.
The JavaScript code and dashboard configuration remain unchanged.
Migration Scope
The CocoaPods registry becomes read-only on December 2, 2026, and MoEngage publishes new SDK versions to CocoaPods until that date. After that date, new MoEngage SDK versions are available only through Swift Package Manager. MoEngage recommends planning the migration ahead of December 2, 2026.Upgrading to
cordova-ios 8 removes and re-adds the iOS platform, which deletes the platforms/ios directory. Any native changes that you made directly in that directory, such as AppDelegate code and notification extension targets, are removed with it.Before You Begin
- Use Xcode 15 or later and Node.js 20.17 or later. These are the minimum versions for
cordova-ios8. - Use
cordova-moengage-core11.0.0 or later. If your application uses the Geofence plugin, usecordova-moengage-geofence4.0.0 or later. - Confirm that every other plugin in your application supports
cordova-ios8. - Identify which extension targets use MoEngage, such as a notification service extension or a content extension.
- Commit or back up the project, including the
platforms/iosdirectory, so that you can copy your native code and extension targets back after the upgrade.
Step 1: Upgrade the MoEngage Plugins
Upgrade the MoEngage Core plugin. If your application uses the Geofence plugin, upgrade it as well.Bash
Bash
Step 2: Note the Native MoEngage Changes
Before you remove the iOS platform, note every MoEngage change in theplatforms/ios directory:
-
The MoEngage initialization code in your
AppDelegate. -
Every
MoEngage-iOS-SDKpod that yourPodfiledeclares for the extension targets, for example:Podfile - The source files and settings of each notification extension target.
cordova-moengage-core plugin adds the MoEngage iOS SDK to the main app target automatically, so pods for the main app target need no replacement.
Step 3: Upgrade to cordova-ios 8
From the project root, remove the iOS platform and addcordova-ios 8:
Bash
cordova-ios installs the MoEngage plugin as a Swift package. The plugin’s Swift package pins the apple-sdk (MoEngage-iOS-SDK) version that your cordova-moengage-core version uses, so you don’t add the MoEngage iOS SDK to the main app target yourself.
In
cordova-ios 8, the Xcode project and the build target are always named App. Update any hook or script that assumes the project name matches the name in config.xml.Step 4: Update the AppDelegate
Oncordova-ios 8 and later, the AppDelegate must be in Swift, and you initialize the SDK through MoEngageCordovaBridge. Add the MoEngage initialization to application(_:didFinishLaunchingWithOptions:) in the AppDelegate that cordova-ios 8 generates:
AppDelegate.swift
dataCenter to the data center of your workspace. For all the initialization methods, including file-based initialization, refer to iOS SDK Initialization. For the replacements of the earlier AppDelegate initialization APIs, refer to the Cordova SDK release notes.
Step 5: Update the Push Notification Extensions
Complete this step only if your application has a notification service extension or a notification content extension that uses MoEngage. Add the extension targets back to theApp project in Xcode, and copy their source files from your backup. The extension targets aren’t part of the plugin’s Swift package, so add the MoEngageRichNotification library manually:
- Open the Cordova release notes, find your
cordova-moengage-coreversion, and note the MoEngage-iOS-SDK version listed under Dependencies > iOS. - In Xcode, select File > Add Package Dependencies, enter
https://github.com/moengage/apple-sdk.git, and set Dependency Rule to Exact Version with the version from the release notes. - On the product screen, set MoEngageRichNotification to the App target, and leave the other products set to None.
- In your notification service extension target, open General > Frameworks and Libraries, click +, and add MoEngageRichNotification. Do the same for your content extension target if you use push templates.
When you upgrade
cordova-moengage-core in the future, open the Cordova release notes, find the version you’re upgrading to, and note the MoEngage-iOS-SDK version listed for it. Then, in Xcode, open Package Dependencies, select apple-sdk, and change its Exact Version to that version. If the apple-sdk version doesn’t match the MoEngage-iOS-SDK version, package resolution fails.Step 6: Update Your Workflow
- In CI and local scripts, remove every
pod installstep that you added for the MoEngage pods. - Use
cordova-ios8 or later in every build environment. Oncordova-ios7 and earlier, the MoEngage plugin installs through CocoaPods.
Step 7: Verify the Migration
- In Xcode, select Product > Clean Build Folder.
-
Build and run the application:
Bash
- Confirm that the SDK initialization logs report the MoEngage SDK version that you upgraded to.
- Select Product > Archive and confirm that the archive succeeds. The archive build tests the extension targets in a release build.
- Send a test push notification. Confirm that the device receives the notification, that the SDK tracks the notification impression (the Notification Received event), and that rich content renders. If the application uses the Geofence plugin, verify geofence functionality as well.