Overview
To enable push messaging functionality for the Mapp Engage Android SDK (v6 or v7), you must integrate Firebase Cloud Messaging (FCM). This section guides you through setting up Firebase and connecting it to your app.
Setup Steps
Step 1: Set Up Firebase in the Developer Console
Log in to the Firebase Developer Console.
Click "Create a Project".
Enter a Project Name. While any name is acceptable, it is recommended that you use something relevant to your app for easier identification.
Review the configuration and continue with creating the project.
.png)
Link an existing Google Analytics account or create a new one.
The project has been created.
After the project is created, go to Project Settings by clicking the gear icon in the top left corner.
.png)
Navigate to the Service Accounts tab, and click "Generate new private key". This will download a JSON file containing the private key. This service account key is required when configuring the Android channel in Mapp Engage.
.png)
Step 2: Integrate Firebase with Your Android App
In the Firebase Console, register your Android app by providing the package name.
.png)
Download the
google-services.jsonfile and place it in the root directory of your Android app module..png)
Update Your Gradle Files: To make the
google-services.jsonvalues accessible to Firebase SDKs, you'll need to add the Google Services Gradle plugin to your project.Root-level (Project-level)
build.gradle.ktsfile:id("com.google.gms.google-services") version "4.4.2" apply falseModule-level (App-level)
build.gradle.ktsfile:Note
Use the latest compatible Firebase BoM version according to your project setup.
plugins { id("com.android.application") // Add the Google services Gradle plugin id("com.google.gms.google-services") ... } dependencies { // Import the Firebase BoM implementation(platform("com.google.firebase:firebase-bom:YOUR_VERSION")) // TODO: Add the dependencies for Firebase products you want to use // When using the BoM, don't specify versions in Firebase dependencies implementation("com.google.firebase:firebase-analytics") // Add the dependencies for any other desired Firebase products // https://firebase.google.com/docs/android/setup#available-libraries }
Sync your project with the updated Gradle files.
Android 13+ Notification Permission
For devices running Android 13 (API level 33) and higher, the app must request the POST_NOTIFICATIONS runtime permission before notifications can be displayed.
Make sure your app:
Declares the permission in the AndroidManifest.xml
Requests the permission at runtime
Without this permission, push notifications will not appear, even if Firebase and the SDK are configured correctly.