<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Aziz</title>
    <description>The latest articles on Forem by Aziz (@aziz_ipro).</description>
    <link>https://forem.com/aziz_ipro</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F347259%2F99a17c2c-8d50-4b36-be00-17ed5b3a0a81.jpg</url>
      <title>Forem: Aziz</title>
      <link>https://forem.com/aziz_ipro</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/aziz_ipro"/>
    <language>en</language>
    <item>
      <title>Android Push Notifications implementation made easy with Bloomreach</title>
      <dc:creator>Aziz</dc:creator>
      <pubDate>Tue, 30 Dec 2025 03:01:19 +0000</pubDate>
      <link>https://forem.com/aziz_ipro/android-push-notifications-implementation-made-easy-with-bloomreach-5ghj</link>
      <guid>https://forem.com/aziz_ipro/android-push-notifications-implementation-made-easy-with-bloomreach-5ghj</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffas31w9y2c854jgam6di.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffas31w9y2c854jgam6di.webp" alt="Push notification" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Push notifications help your app engage users effectively. This guide explains how to implement push notifications on Android using Bloomreach(formerly Exponea) from scratch to a working feature.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Android app using Kotlin&lt;/li&gt;
&lt;li&gt;Firebase Cloud Messaging (FCM) configured&lt;/li&gt;
&lt;li&gt;Bloomreach account with push enabled&lt;/li&gt;
&lt;li&gt;Basic understanding of Android app lifecycle&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  High Level Architecture
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;App registers with FCM and obtains a device token&lt;/li&gt;
&lt;li&gt;Token is sent to Bloomreach SDK&lt;/li&gt;
&lt;li&gt;Bloomreach sends push campaigns via FCM&lt;/li&gt;
&lt;li&gt;FCM delivers message to device&lt;/li&gt;
&lt;li&gt;App displays notification&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Firebase Setup
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Add Firebase to your project via Firebase Console.&lt;/li&gt;
&lt;li&gt;Place &lt;code&gt;google-services.json&lt;/code&gt; in your &lt;code&gt;app/&lt;/code&gt; folder.&lt;/li&gt;
&lt;li&gt;Add dependencies in &lt;code&gt;build.gradle&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;implementation platform('com.google.firebase:firebase-bom:33.0.0')
implementation 'com.google.firebase:firebase-messaging-ktx'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply Google services plugin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;plugins {
  id 'com.google.gms.google-services'
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Integrating the Bloomreach SDK(formerly Exponea)
&lt;/h3&gt;

&lt;p&gt;Step 1: Add Exponea SDK&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;implementation("com.exponea.sdk:sdk:4.8.1")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2: Initialize SDK&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Obtain projectToken, authorization, and baseURL from Bloomreach Engagement portal under &lt;em&gt;Project Settings &amp;gt; Access Management &amp;gt; API&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Ensure tracking consent is obtained before initialization
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;val configuration = ExponeaConfiguration()
configuration.authorization = "Token YOUR_API_KEY"
configuration.projectToken = "YOUR_PROJECT_TOKEN"
configuration.baseURL = "https://api.exponea.com"
Exponea.init(this, configuration)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 3: Place SDK Initialization&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In your Application subclass onCreate() method:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class MyApplication : Application() {
  override fun onCreate() {
  super.onCreate()

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

  Exponea.init(this, configuration)
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Register your custom application class in &lt;code&gt;AndroidManifest.xml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;application android:name=".MyApplication"&amp;gt;...&amp;lt;/application&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Push Notifications Setup
&lt;/h3&gt;

&lt;p&gt;Enable Push Notifications&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bloomreach Engagement sends notifications via scenarios.&lt;/li&gt;
&lt;li&gt;Notifications can be standard alerts or silent for background tasks.
Implement Firebase Messaging Service
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;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)
    if (!Exponea.handleRemoteMessage(applicationContext, message.data, notificationManager)) {
    // message from another provider
    }
  }

  override fun onNewToken(token: String) {
    super.onNewToken(token)
    Exponea.handleNewToken(applicationContext, token)
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Register service in &lt;code&gt;AndroidManifest.xml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;service android:name="MyFirebaseMessagingService" android:exported="false"&amp;gt;
  &amp;lt;intent-filter&amp;gt;
    &amp;lt;action android:name="com.google.firebase.MESSAGING_EVENT" /&amp;gt;
  &amp;lt;/intent-filter&amp;gt;
&amp;lt;/service&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Configure FCM in Bloomreach
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Create a service account in Google Cloud and generate a private key&lt;/li&gt;
&lt;li&gt;In Bloomreach Engagement, add Firebase Cloud Messaging integration using the JSON key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvm83tj3fk7awjgxb2skg.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvm83tj3fk7awjgxb2skg.webp" alt="Dashboard" width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select the integration in &lt;em&gt;Project Settings &amp;gt; Channels &amp;gt; Push Notifications &amp;gt; Firebase Cloud Messaging Integration&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftcys9lrh40kyne2dlht2.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftcys9lrh40kyne2dlht2.webp" alt="Integration" width="800" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After setup, your app can receive push notifications via Bloomreach and track tokens automatically&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3q1wiwokx2t9pybueik0.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3q1wiwokx2t9pybueik0.webp" alt="Push part" width="800" height="582"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>android</category>
      <category>notification</category>
      <category>kotlin</category>
      <category>mobile</category>
    </item>
  </channel>
</rss>
