Android Push Notifications implementation made easy with Bloomreach

Published: (December 29, 2025 at 10:01 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

Aziz

Push notification

Introduction

Push notifications help your app engage users effectively. This guide explains how to implement push notifications on Android using Bloomreach (formerly Exponea) – from a blank project to a working feature.

Prerequisites

  • Android app written in Kotlin
  • Firebase Cloud Messaging (FCM) configured
  • Bloomreach account with push enabled
  • Basic understanding of the Android app lifecycle

High‑Level Architecture

  1. App registers with FCM and obtains a device token.
  2. Token is sent to the Bloomreach SDK.
  3. Bloomreach sends push campaigns via FCM.
  4. FCM delivers the message to the device.
  5. App displays the notification.

Firebase Setup

  1. Add Firebase to your project via the Firebase Console.
  2. Place google-services.json in the app/ folder.

Gradle dependencies

implementation platform('com.google.firebase:firebase-bom:33.0.0')
implementation 'com.google.firebase:firebase-messaging-ktx'

Apply the Google Services plugin

plugins {
  id 'com.google.gms.google-services'
}

Integrating the Bloomreach SDK (formerly Exponea)

Step 1 – Add the SDK

implementation("com.exponea.sdk:sdk:4.8.1")

Step 2 – Initialize the SDK

Obtain projectToken, authorization, and baseURL from the Bloomreach Engagement portal (Project Settings → Access Management → API).
Make sure you have user tracking consent before initializing.

val configuration = ExponeaConfiguration().apply {
    authorization = "Token YOUR_API_KEY"
    projectToken = "YOUR_PROJECT_TOKEN"
    baseURL = "https://api.exponea.com"
}
Exponea.init(this, configuration)

Step 3 – Place SDK initialization in your Application subclass

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        val configuration = ExponeaConfiguration().apply {
            authorization = "Token YOUR_API_KEY"
            projectToken = "YOUR_PROJECT_TOKEN"
            baseURL = "https://api.exponea.com"
        }

        Exponea.init(this, configuration)
    }
}

Register the custom application class in AndroidManifest.xml:

<!-- Add your application tag here -->

Push Notifications Setup

Enable Push Notifications in Bloomreach

  • Bloomreach Engagement sends notifications via scenarios.
  • Notifications can be standard alerts or silent (background) messages.

Implement a Firebase Messaging Service

import android.app.NotificationManager
import android.content.Context
import com.exponea.sdk.Exponea
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage

class MyFirebaseMessagingService : FirebaseMessagingService() {

    private val notificationManager by lazy {
        getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
    }

    override fun onMessageReceived(message: RemoteMessage) {
        super.onMessageReceived(message)
        // Let Bloomreach handle the message; return false if it’s from another provider
        if (!Exponea.handleRemoteMessage(applicationContext, message.data, notificationManager)) {
            // Handle non‑Bloomreach messages here
        }
    }

    override fun onNewToken(token: String) {
        super.onNewToken(token)
        Exponea.handleNewToken(applicationContext, token)
    }
}

Register the service in AndroidManifest.xml:

<!-- Add your service declaration here -->

Configure FCM in Bloomreach

  1. Create a service account in Google Cloud and generate a private key (JSON).
  2. In Bloomreach Engagement, add a Firebase Cloud Messaging integration using that JSON key.

Dashboard

Select the integration in Project Settings → Channels → Push Notifications → Firebase Cloud Messaging Integration

Integration

After completing the setup, your app will receive push notifications sent through Bloomreach and token tracking will be handled automatically.

End of guide.

Back to Blog

Related posts

Read more »

Happy New Year, community!

Introduction Hello everyone who comes across this blog, and Happy New Year! Project Overview The final goal of this project is an application with a purely dec...

RxJava Fundamentals - Reactive Programming on Android

RxJava의 기본 개념과 안드로이드에서의 활용법을 알아봅니다. RxJava란? RxJava는 Reactive + Functional Programming을 결합한 라이브러리입니다. 핵심 개념 - 데이터와 처리를 분리하고, 데이터는 처리에 푸시만 합니다. - Threading을 라이브러...