Customer.io
  • Platform
  • Pricing
  • Resources
  • Company
  • Sign In
Request Demo
  • Features
  • Pricing
  • Customers
  • Docs

Request Demo Sign In
  • Documentation
    • Getting Started
    • Accounts & Workspaces
    • People
    • Segmentation
    • Campaigns & Workflows
    • Message Channels
    • Liquid & Personalization
    • Metrics
    • Data & Integrations
  • API
    • API Reference
    • Reporting Webhooks
    • Integration Libraries
  • SDK
    • iOS
    • Android
  • Release Notes
Android
  • Get Started
  • Identify people
  • Track events
  • Push notifications
  • Rich push notifications
  • Test support
  • Migrate from an earlier version
  • Changelog
    • Get Started
    • Identify people
    • Track events
    • Push notifications
    • Rich push notifications
    • Test support
    • Migrate from an earlier version
    • Changelog
    • Get Started
    • Identify people
    • Track events
    • Push notifications
    • Rich push notifications
    • Test support
    • Migrate from an earlier version
    • Changelog
    • In-app messages

40

Push notifications

Get started setting up push notifications for Android. Our Android SDK supports push notifications over FCM.

This page is part of an introductory series to help you get started with the essential features of our SDK. The highlighted step(s) below are covered on this page. Before you continue, make sure you've implemented previous features—i.e. you can't identify people before you initialize the SDK!

graph LR getting-started(Install SDK) -->B(Initialize SDK) B --> identify(identify people) identify -.-> track-events(Send events) identify -.-> push(Receive push) identify -.-> rich-push(Receive Rich Push) track-events --> test-support(Handle errors) push --> test-support rich-push --> test-support identify -.-> in-app(Receive in-app) in-app --> test-support click getting-started href "/docs/sdk/android/alpha/getting-started" click B href "/docs/sdk/android/alpha/getting-started/#initialize-the-sdk" click identify href "/docs/sdk/android/alpha/identify" click track-events href "/docs/sdk/android/alpha/track-events/" click push href "/docs/sdk/android/alpha/push" click rich-push href "/docs/sdk/android/alpha/rich-push" click in-app href "/docs/sdk/android/alpha/in-app" click test-support href "/docs/sdk/android/alpha/test-support" style push fill:#B5FFEF,stroke:#007069

Before you begin

This page explains how to receive push notifications using our SDK. However, before you can send push notifications to your audience, you need to enable Customer.io to send push notifications through Firebase Cloud Messaging (FCM).

This process lets you receive basic push notifications in your app—a title and a message body. To send a notification with an image, link, etc, complete the process on this page, and then see our rich push documentation.

 Check out our sample app!

Our Remote Habits app, provides a real-world example and can act as a template to help you implement the SDK.

How it works

Before a device can receive a push notification, you must:

  1. Set up FCM.
  2. Implement the messaging-push-fcm SDK.
  3. Identify a person. This associates a push token with the person, so that they can receive push notifications.
  4. Set up a campaign to send a push notification through the Customer.io composer.

Set up push

You must implement the Push Messaging SDK to use push notification features.

implementation 'io.customer.android:messaging-push-fcm:<version-here>'

The SDK adds a FirebaseMessagingService to the app manifest automatically, so you don’t have to perform additional setup to handle incoming push messages.

If your application implements its own FirebaseMessagingService, make sure that when you call onMessageReceived and onNewToken methods, you also call CustomerIOFirebaseMessagingService.onMessageReceived and CustomerIOFirebaseMessagingService.onNewToken respectively.

class FirebaseMessagingService : FirebaseMessagingService() {

 override fun onMessageReceived(message: RemoteMessage) {
    val handled = CustomerIOFirebaseMessagingService.onMessageReceived(message)
    if (handled) {
        logger.breadcrumb(this, "Push notification has been handled", null)
    }
 }
 
override fun onNewToken(token: String) {
    CustomerIOFirebaseMessagingService.onNewToken(token)
}

Push notifications launched from the SDK are currently posted to our default channel—[your app name] Channel. In the future, we plan to let you customize channels/categories so that users can subscribe and unsubscribe to content categories as necessary.

Capture push metrics

Customer.io supports three device-side metrics that help you determine the efficacy of your push notifications: delivered, opened, and converted.

By default, the messaging-push-fcm SDK automatically tracks opened and delivered for push notifications originating from Customer.io. Otherwise, you can track push metrics with the trackMetric method.

CustomerIO.instance().trackMetric(
    deliveryID = deliveryId,
    deviceToken = deliveryToken,
    event = MetricEvent.delivered
)
Copied to clipboard!
    • Before you begin
      • How it works
    • Set up push
    • Capture push metrics
Latest release
Stable
Is this page helpful?

How can we make it better?

We appreciate your feedback!


Product
  • Features
  • Customer Success
  • Professional Services
  • Pricing
  • Workflows
  • Ad Audience Sync
  • Watch a Demo Video
Resources
  • Documentation
  • Release Notes
  • Customer.io API
  • Getting Started Guide
  • Integrations Catalog
  • Data Export Methods
  • Security and Compliance
Industry
  • SaaS
  • EdTech
  • Two-Sided Marketplaces
  • FinTech
  • Internet of Things (IoT)
  • Subscription Box
  • Media Companies
Company
  • Blog
  • Support
  • Partners
  • Customers
  • About
  • Careers
  • Contact Us
  • Privacy Policy
  • Terms of Service
  • Status
  • © Peaberry Software, Inc.