Migrate to Flutter Unified Plugin

Migrate from the Marketing Cloud Engagement-specific or the Marketing Cloud Next-specific Flutter plugins to the unified Flutter plugin model.

The previous Flutter integration for Marketing Cloud Engagement uses one monolithic package (sfmc) and one static class (SFMCSdk) for all features. Similarly, the integration for Marketing Cloud Next uses a separate monolithic package (mam) with its own static class (MobileAppMessaging).

The key changes in the Flutter unified implementation are:

  • The previous monolithic packages are split into focused packages: sfmc_core for core services, sfmc_push for push notifications, sfmc_iam for in-app messaging, sfmc_marketingcloudsdk for Marketing Cloud Engagement, and sfmc_mobileappmessaging for Marketing Cloud Next.
  • Static method calls are replaced with async module initialization using requestSdk().
  • Identity, attribute, and event-tracking methods are moved to sfmc_core.
  • In-App Messaging (sfmc_iam) is a new, optional feature package with lifecycle events and display control. No equivalent existed in the previous Engagement-specific Flutter plugin.
  • Several callback-based listeners, such as the listeners for registration events and push tokens, are replaced with Dart streams that use EventChannel.

Use this table to map dependencies from the previous, non-unified plugin to their equivalent packages in the unified plugin.

Previous Flutter dependencyUnified DependencyRequired?
sfmc (MobilePush / Engagement)sfmc_marketingcloudsdkRequired. This package replaces the Engagement-specific package.
mam (Marketing Cloud Next)sfmc_mobileappmessagingRequired. This package replaces the Marketing Cloud Next-specific package.
Identity, attributes, and events bundled inside sfmcsfmc_coreAuto-installed as a transitive dependency of any product package.
Push messaging support bundled inside sfmcsfmc_pushRequired if your app sends push notifications.
No Dart equivalent (native-only or config-only)sfmc_iamRequired if your app uses in-app messages. This is a new capability with a Dart API.

Before you begin your migration, make sure you meet these prerequisites:

  • Have your existing Marketing Cloud configuration values—such as App ID, Access Token, Server URL, and MID—available.
  • Perform the migration on a feature branch. Avoid mixing the migration with unrelated work.
  • Be prepared to update both Dart call sites and native (Android and iOS) setup files.
  • Make sure your app meets these minimum requirements:
ComponentsMinimum Requirement
Flutter3.3.0 or later
Dart SDK>=3.0.6 <4.0.0
iOS12.0 or later
AndroidminSdk 26, compileSdk 36