
Mike Miller
April 03, 2023

Push notifications are a critical part of modern mobile apps, helping you keep users engaged, informed, and connected in real time. But implementing push across different platforms—especially on Android—can quickly become complex. Developers must manage device tokens, handle permissions, test notifications, and deal with platform-specific quirks.
Courier’s Android Mobile Notifications SDK is built to simplify that process. It provides a set of tools that make it easier to manage user state, handle token registration and lifecycle, and send test push notifications—all without the heavy setup typically required.
Before we dive into the technical setup, here’s a quick overview of the key benefits Courier’s Android SDK offers:
By removing the friction of manual token and state management, Courier helps Android developers get push notifications up and running faster—and more reliably.
Let’s walk through how to get started with the Courier Android SDK.
To get started with the Courier Android SDK, you will need to have the following:
To install the Courier Android SDK have a look at the step-by-step guide on our GitHub page.
Once you’ve successfully set up the Courier SDK in your Android app, let's dive into some of the features of the SDK.
A note to the developers amongst you: Some of the functions that we will cover below depend on an AppCompatActivity, just something to keep in mind as we move forward.
Before sending push notifications, it’s critical to manage user state properly—meaning whether a user is signed in, signed out, or otherwise active within your app.
User state directly impacts the notification experience. For example, if a user signs out, they shouldn’t continue receiving personalized push messages intended for active sessions. Failing to sync user state with notification delivery can lead to confusion, privacy issues, and a degraded app experience.
Courier’s Android SDK helps you keep user state and push tokens automatically in sync, minimizing manual overhead.
To manage user state with Courier:
Use the Courier.shared.signIn() method when a user signs into your app. This ensures the user’s device tokens are correctly registered and associated with their session.
Courier.shared.signIn(accessToken = authKey_or_accessToken,userId = userId)
The accessToken can either be a Courier Auth Key used during development or a JWT (JSON Web Token) that should be used in your production app.
When the user signs out, you can use the Courier.shared.signOut() function to clear their state.
Courier.shared.signOut()
By following these steps, the FCM (Firebase Cloud Messaging) tokens on Android will be automatically synced to Courier, making it easier for you to manage the user's state and send relevant and timely push notifications.
A smooth notification experience starts with asking users for permission at the right moment in their journey. However, managing permission requests manually can be tricky—especially across different Android versions.
Courier simplifies this process with the requestNotificationPermission() function, allowing you to easily check and request notification permissions in your app:
if (requestNotificationPermission()) {//Send some notification}
The requestNotificationPermission() function returns a Boolean:
true if the user has granted notification permissionsfalse if permissions are deniedThis makes it easy to conditionally trigger next steps, such as sending a test notification once permission is confirmed.
On newer versions of Android (version 33 and above), calling this function automatically prompts users with a system permission request for push notifications.
On older Android versions, the function will always return true by default, since explicit permission isn’t required.
By using Courier’s permission tools, you can ensure a smoother, more consistent push notification experience across all Android devices.
Courier’s Android SDK includes the onPushNotificationDelivered() function, which is triggered whenever a push notification is successfully delivered to a user’s device.
This makes it easy to:
override fun onPushNotificationDelivered(message: RemoteMessage) {print(message)}
Important:
TheonPushNotificationDelivered()function is only triggered when the app is in the foreground or background state.
It will not be called if the app is completely closed ("killed" or "not running" state).To use this callback, the activity must extend
CourierActivity, which is a subclass ofAppCompatActivity.
While tracking delivery is important, it's just as critical to know when users actually interact with your notifications.
Courier’s Android SDK makes this easy with the onPushNotificationClicked() function.
This callback is triggered whenever a user taps on a push notification, allowing you to define exactly what should happen next—whether it’s opening a specific screen, starting an action, or recording engagement.
override fun onPushNotificationClicked(message: RemoteMessage) {print(message)}
In the example above, the function simply prints the notification payload.
In a real app, you would replace this with your own logic—such as opening a specific activity, deep-linking to a screen, or displaying a custom UI component based on the notification content.
Now that you’ve handled permissions and know how to track delivery and user interactions, let’s walk through how to send a test push notification.
Courier makes this process simple:
You can send a push notification directly to a user’s ID using the SDK—without needing to manually call Firebase from your backend or handle raw HTTP requests.
The userId you send to should match the IDs you use in your existing authentication system.
This ensures consistency and simplifies managing user state and tokens across your app.
To send a test push, use the sendPush() function:
val messageId = Courier.shared.sendPush(authKey: 'a_courier_auth_key_only_for_testing',userId: 'example_user',title: 'Hello!',body: 'This is a push message from Courier 🐣',providers: [CourierProvider.fcm],)
Caution:
ThesendPush()function will send a push notification to every valid device token associated with the specifieduserIdand provider (e.g., FCM).Be sure to use this feature only for testing purposes.
Also, remember: the
authKeyshown in the example is intended for development and testing only—it should never be used in production environments.
One of the most challenging parts of implementing push notifications is managing device tokens—the unique identifiers assigned to each device that can receive notifications.
These tokens are typically generated and managed by platform-specific services like:
To reliably send push notifications, you must:
Building this infrastructure manually often requires extensive collaboration between frontend (mobile) and backend developers. This back-and-forth—designing workflows, handling edge cases, managing token lifecycles—can easily stretch across days or even weeks of development time.
Courier simplifies token management automatically.
With Courier’s mobile SDKs, you don’t need to build token handling from scratch.
Courier:
This means you can focus on building your product—not spending extra cycles architecting and maintaining a complex token management system.
Implementing push notifications doesn’t have to be complicated.
In this guide, you’ve seen how Courier’s Android SDK streamlines the entire process—handling token generation, secure storage, and automatic token removal—so you can focus on building great app experiences instead of managing infrastructure.
With just a few lines of code, you can integrate reliable push notifications into your Android app—no need to reinvent token management or notification delivery tracking.
Courier also offers SDKs for other platforms, including:
Whether you're building a native Android app, a cross-platform experience, or scaling across devices, Courier’s SDKs can simplify your push notification strategy—making setup faster, testing easier, and delivery more reliable.
If you're ready to streamline your mobile notifications, get started with Courier today.

Experiments: A/B test your messages inside Journeys
Experiments bring A/B testing into Journeys. On any send node, run 2 to 10 message variants, split traffic by weight, and Courier buckets each recipient deterministically, keeping them in the same variant across sends. Compare sent, delivered, open, and click rates per variant, then promote the one you want, without leaving your journey or bolting on a separate testing tool.
By Thomas Schiavone
July 09, 2026

AI Translation: localize any template in seconds
Courier AI Translation brings built-in localization to Design Studio. Add a language to any template and AI translates every string in seconds. Works across email, SMS, push, in-app, and chat. Review side by side, override anything, and publish from the same editor you already use.
By Thomas Schiavone
June 26, 2026

Inbox SDKs for Vue and Angular: a native in-app notification center
Courier now ships first-class inbox SDKs for Angular and Vue. Drop in a real-time notification center, toasts, and a preferences center with native components, an injectable service, and a composable, all backed by the same in-app inbox that already powers React and JavaScript apps.
By Mike Miller
June 19, 2026
© 2026 Courier. All rights reserved.