Push Notifications - Getting Started
Let's get you started sending mobile push notifications with Customer.io! There are two parts to setup:
- What needs to be done in the interface, which is what this doc will help with, and
- Changes to your app. For that, you can have a look at our Technical Integration Guide
Before you can add a push notification to your workflow, you'll first need to enable it in your Email & Actions settings. There, you'll see fields for both Android and iOS platform configuration.
Sending push notifications to Android devices is done via Firebase Cloud Messaging. You'll need to generate a .JSON server key, which you enter in the push notification settings. Here's how you do that:
- Make sure that the Firebase Cloud Messaging API is enabled for your project. You can check that here.
- Log into the Firebase Console for your project
- Head into your Project settings by clicking on the gear icon in the sidebar:
- Select the Service Accounts tab and click on the Generate New Private Key button. You will see a confirmation dialog after which the prompt to download the credential file should appear:
This will generate the JSON key that you can upload into your Android settings:
Sending to iOS via Firebase
You will see this option in your iOS configuration:
What it means is that we can use Firebase Cloud Messaging to identify and send messages to iOS devices as well, provided that you've set up FCM to do so. This might make sense for you if FCM is a critical part of your infrastructure, and you don't plan on configuring the Apple Push Notification Service anytime soon.
If you select the option, you will be able to send to iOS via FCM. Please note, you will still need to setup the configuiration for Android if you haven't yet done so.
Sending push notifications to Apple devices is done via the Apple Push Notification service (APNs). You'll need a few things:
- A .p8 certificate from APNs, which you upload to Customer.io
- A Key ID, Team ID, and Bundle ID for your app. These are usually found in your Apple Developer Account.
Testing your configuration
There are a couple of ways to make sure that your initial configuration is working. You can send a single test message from the settings, or (if you have an iOS app) use a separate sandbox environment for your tests.
Sending a single test message
If you want to send a single test message to make sure your configuration and certificates are working, you can do that from within a platform settings page, right next to the platform certificates (after they have been uploaded):
Enter your token you'd like to test with (see how to find those here), and you'll hopefully get a test push to that device with the following content: "If you're reading this, it means your integration with Customer.io is working!" and you're set to start adding push notifications to your campaigns.
Sending to an iOS sandbox environment
Your iOS certificate may have both sandbox and production environments. If you'd like to send all of your push notifications to your sandbox environment, you can choose that option in your iOS configuration.
Creating Push Notifications
When it comes time to add push notifications to your campaign, you'll see it as an enabled action in your workflow. Go ahead and add it:
Then, you can add content to your push notification, change its behaviour from Queue Draft to Send Automatically, or Don't Send (skip), add action conditions, etc.
You will also see an option to choose which platform you'd like to send your push notification to (for example, if you only want to send to one of iOS or Android):
When you click to add content, you'll be brought to the composer, where your message has three elements:
To: By default, your push notification will go to all devices associated with a particular user. However, you have two other options:
- "Last used device": This will send the message to the device that your customer most recently used to interact with your app. You can provide this last used timetamp when updating devices via our API.
- Customize: If you have a specific device token that you'd like to send to, or use a Liquid variable, you can do so here.
Title is what appears above the main text of your message. This is optional. If you don't specify one, then...
- For Android devices, it will default to your app name.
- For iOS devices, the title simply doesn't display.
Message is your message text. This can be as long as you like, though brevity will likely serve you well!
And that's it! Save, and you've set up a push notification in Customer.io. Next, you're ready to track their success.
To preview your push notification, hit the Preview toggle to see what it might look like:
We've chosen an "Alert" style for our display, but kept it fairly generic due to the sheer amount of devices that might be out there. To truly see what it looks like on a specific device, we encourage you to send a test to that device.
If you'd like to test one aspect of a push notification's content (a slight copy change, perhaps), you can do that by creating an A/B test from the push notification workflow item, like this:
Then, once you start your test and your campaign is active, you can check in on the results in the A/B test tab:
QA for Push Notifications
If you want to send a single test push to a particular device for QA purposes, you'll need to have a device token ready.
How to find your device token(s)
You may already have some test device tokens handy, but if you want to test with a specific user, you can find these in a few places on an individual Person page. First, you'll find them on the Overview, as well as in the Devices tab:
From either of these places, you can quickly copy a device token to your clipboard.
QA your Push content
To see your push notification's content on a single device, paste your device token into the "Send test..." box in the Push composer and send a test to it. You may see a "Device type" option if you have both Android and iOS enabled, and you'll need to tell us which type your test device is:
If you've chosen to send to sandbox in your Push settings, that will be enabled here. To disable it, you'll need to return to your settings and uncheck that box:
Once you've sent a test, you'll be able to quickly re-use that token, too. Check the box and we'll auto-fill the value for you:
Using Event/Attribute/Broadcast Data
As with all other Customer.io messages, you can use relevant customer data in your notification! If you've got an event or API triggered broadcast campaign, you can also use event and broadcast data! Here's an example of a weather alert using data, and its preview result:
We are actively working to improve on this feature! Please let us know your feedback.
- Found a bug?
- Have a feature request?
- Something doesn't work as you expected?
- Is some functionality missing?
- Or are you loving the new changes and want to make sure we keep something?