React Native Plugin for the MobilePush SDK

Use the React Native plugin to integrate the MobilePush SDK into your iOS and Android apps.

If you’re integrating the MobilePush SDK with React Native plugin for the first time, use React Native Unified Plugin Setup.

If your package.json contains the unscoped react-native-marketingcloudsdk dependency, your app uses the Engagement-specific React Native plugin. If you’re already on the Engagement-specific React Native plugin, use this section to update your configuration or troubleshoot issues.

Unified mobile SDK continues to support the existing React Native plugin for Marketing Cloud Engagement, however for the most seamless experience, use the React Native unified plugin. To migrate to the React Native unified plugin, follow the guidelines in Migrate to React Native Unified Plugin which explains the package rename, React Native version jump, new architecture prerequisite, and the API changes.

Before you install the React Native plugin in your app, upgrade the native MarketingCloudSdk to the latest supported version. If you use MarketingCloudSdk version 7, first upgrade to version 8, and then upgrade to version 9 or later. This sequence upgrade through version 8 preserve in-place migrations, such as schema and preference upgrades. You can upgrade to a specific plugin version by using npm or Yarn.

The Engagement-specific React Native plugin has these baseline requirements:

ComponentMinimum RequirementRecommendation
React Native0.60 or laterFor React Native 0.85.1 or later with the new architecture, use the React Native unified plugin.
iOSSee MobilePush SDK for iOS release notesMatch the deployment target supported by your MobilePush SDK for iOS version.
AndroidSee MobilePush SDK for Android release notesMatch the minSdk or compileSdk supported by your MobilePush SDK for Android version.
  1. Import the SDK modules into your application.

    • For iOS apps, import both SFMCSDK and MarketingCloudSDK into AppDelegate.
    • For Android apps, import SFMCSdk into MainApplication.java.
  2. Add the React Native plugin to your application using npm or Yarn.

    The React Native plugin requires React Native version 0.60 or later.