Migration Of WebEngage SDK From Cocoapods To SPM

Swift Package Manager (SPM) is now the recommended way to integrate the WebEngage iOS SDK. WebEngage is deprecating CocoaPods support for new projects and strongly recommends SPM for all new and existing integrations.

Step 1: Remove CocoaPods Integration

Start by cleanly removing the existing CocoaPods configuration from your project.

  1. Open your project’s Podfile in a text editor.
  2. Remove any line that references the WebEngage SDK, for example:
    pod 'WebEngage'
    
    # check which ever SDK is integrated already, and based on that remove it.
    pod 'WEPersonalization'
    pod 'WebEngage/Core'
    pod 'WENotificationInbox'
  3. Save the file and open your project’s root directory in the terminal.
  4. Run the following command to update your workspace:
    pod install

This will regenerate your project without the WebEngage CocoaPods dependency.

Step 2: Integrate via Swift Package Manager

Now add the WebEngage SDK through Swift Package Manager in Xcode.

  1. Open your project in Xcode.
  2. Go to File → Add Package Dependencies.
  3. In the search field, enter the WebEngage SDK repository URL:
    https://github.com/WebEngage/webengage-ios-sdk.git
  4. When prompted for the dependency rule, choose either:
    • Branch: main, or
    • Up to Next Major Version and select the latest stable version.
  5. Click Add Package.
  6. In the Choose Package Products step, select the WebEngage modules your app uses:
  7. Under Add to Target, select the app target(s) where you want to integrate the SDK.

For detailed instructions on SPM integration, refer to the SPM Integration Guide.

🚧

Be sure to include the Swift package products that correspond to the WebEngage features currently enabled in your app (e.g., Location, Personalization, Notification Inbox).

Step 3: Post-Migration Verification

After completing the migration, verify that the integration is working correctly.

  1. Open your project workspace in Xcode.
  2. In the Project Navigator, confirm that the WebEngage package appears under the Dependencies / Package Dependencies section.
  3. Clean the build folder (Product → Clean Build Folder) and build the project.
  4. Run the app and verify that:
    • The project compiles without errors.
    • The SDK initializes successfully (check logs or a test event).
    • Existing WebEngage features (events, notifications, location tracking) continue to function as expected.

This migration preserves your current WebEngage configuration while moving to the modern Swift Package Manager workflow.