Configure the React Native Plugin for Android Apps
After you install and configure the React Native plugin, configure the plugin to enable push support for the Android platform.
For new React Native integrations, use the React Native Unified Plugin Setup.
This topic is intended for customers who use the existing React Native plugin for Marketing Cloud Engagement.
Before you configure the React Native plugin for Android apps, make sure that the plugin is installed and configured for your app. See Marketing Cloud React Native Plugin.
Add the repository to your build.gradle file.
To enable push support for Android, provide your FCM credentials by placing the google-services.json file in the android/app directory.
-
Download the
google-services.jsonfile from your app’s Firebase console and place it in your project’sandroid/appdirectory. -
Include the Google Services plugin in your
android/build.gradlefile. -
Add the plugin to your
build.gradlefile.
Configure the SDK in your main application class.
React Native templates default to Kotlin (MainApplication.kt). However, older templates still support Java (MainApplication.java). When you configure the SDK, select the file type that matches your project.
View Java code example
To customize push notification functionality for Android apps, see the notification customization guide.
To implement the Carousel and Button actions features introduced in version 9 of the SDK, see Configure Button and Carousel Actions.