Push notification channel
Updated 🎉New in v4.7.0Starting in Android 8.0, Android added support for “notification channels,” which categorize notifications for your app. All messages belong to a “channel,” which determines behaviors for the notification and gives users control over which channels they want to see notifications from. For example, if you had a news app, you might have different channels for sports, entertainment, and breaking news.
Today, Customer.io supports a single channel per app, and it has three settings, listed in the table below. You can customize your channel when you first set up the Customer.io SDK, but you cannot change the channel ID or importance level after you’ve created a channel. You can only change the channel name. Learn more from the official Android developer docs.
Channels are created on the audience’s side when they receive their first push from Customer.io. Users can see your channel in their device settings.
Channel setting | Default | Description |
---|---|---|
Channel ID | [your package name] | The ID of the channel. |
Channel name | [your app name] Notifications | The name of the channel. |
Importance | 3 | The importance of the channel. Acceptable values are 0 (min), 1 (low), 2 (medium), 3 (default/high), and 4 (urgent). See the Android developer documentation for more about the behavior of each importance level. |
Channel configuration
When you first integrate with the Customer.io SDK, you can set up your Android channel. Remember, after you’ve released a version of your app with channel settings, you can only change the channel name. Changes to other settings have no effect.
You’ll customize your channel in your app’s manifest.
<manifest>
<application>
<meta-data
android:name="io.customer.notification_channel_id"
android:value="channel_id_value" />
<meta-data
android:name="io.customer.notification_channel_name"
android:value="Channel Name" />
<meta-data
android:name="io.customer.notification_channel_importance"
android:value="4" />
</application>
</manifest>
What channel settings can I change?
When you first set up the Customer.io Android SDK, you can customize your channel. But after you release a version of your app with the Customer.io SDK, you cannot change the channel ID or importance level. After that, you can only change the channel name. (This is a limitation imposed by Android, not Customer.io.)
If you released your app with a version of the Customer.io Android SDK prior to 4.7.0, you can delete your old channel and create a new one with completely new settings per Android’s developer documentation.
The chart below shows what channel settings you can or can’t change:
with Customer.io?} a-->|yes|b{Are you migrating channels
from another platform?} a-->|no|c{Were you integrated with
Customer.io Android SDK
v4.7.0 or earlier?} c-->|yes|d(You can delete your current
channel and customize a new one.) b-->|no|e(You can customize
your channel) b-->|yes|f(You can set your channel
name. You cannot change your
channel ID or importance.) c-->|no|f
Delete a channel
If you’ve released a version of your app with the Customer.io SDK earlier than v4.7.0, you can delete your old channel and create a new one with completely new settings per Android’s developer documentation.
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
val id: String = context.packageName
notificationManager.deleteNotificationChannel(id)