Set up Android notification categories (channels) in OneSignal to improve user control and customization of push notifications.
Android notification categories (aka notification channels) were introduced in Android 8.0 (Oreo) to give users greater control over how they receive notifications from your app. Each category defines its own settings such as sound, vibration, badge behavior, and lock screen visibility.
OneSignal makes it easy to create and manage these categories directly from the dashboard. Alternatively, you can define them programmatically in your app.
To programmatically define categories, see Android’s guide to creating notification channels.
Example of an app's notification categories on the device
OneSignal automatically creates two default categories:
Used when no category is set.
Used when the app is force-quit and reopened, restoring previous notifications that were cleared.
If you always send push notifications with a custom category, the “Miscellaneous” channel won’t appear on user devices. The “Restored” channel will always appear to handle restored notifications after force-closing.
On Huawei devices, OneSignal does not set a default category. If you don’t include one, Huawei will apply High importance by default.
Where to add Android categories in OneSignal
You’ll be asked to define the following:
User-visible. Keep it clear and descriptive.
User-visible. Briefly explain the type of notifications this category will handle.
Controls how visible and interruptive the notification is:
alert_beep
(not alert_beep.wav
)0, 300, 500, 300
→ Wait 0ms, vibrate 300ms, pause 500ms, vibrate 300ms.Some Android devices support LED indicators:
FF0000FF
for blue)Shows badge count on app icon:
Once your category is created, you can use it in your notifications.
After a device receives a notification from a category, Android locks that category’s behavior. Changes to importance, sound, vibration, or other settings will not apply retroactively.
Options:
You can update:
These will update in Android’s notification settings when the next notification is received using that updated channel.
To remove a deleted category from the user’s device:
The SDK will re-sync and remove the deleted category from Android settings.
Use the android_channel_id
in the Create message API request.
Find the Channel ID in the Android Category setup screen
If using your own Android-defined channels, use existing_android_channel_id
instead.
Application
class, not an Activity
. See Android SDK Setup.No. OneSignal does not set setBypassDnd
on categories. To override DND, create your own channel programmatically and enable this setting. See setBypassDnd.
No. OneSignal does not support multiple languages for categories. To support localization, define your own Android channels and reference them via existing_android_channel_id
in your push API requests.
Set up Android notification categories (channels) in OneSignal to improve user control and customization of push notifications.
Android notification categories (aka notification channels) were introduced in Android 8.0 (Oreo) to give users greater control over how they receive notifications from your app. Each category defines its own settings such as sound, vibration, badge behavior, and lock screen visibility.
OneSignal makes it easy to create and manage these categories directly from the dashboard. Alternatively, you can define them programmatically in your app.
To programmatically define categories, see Android’s guide to creating notification channels.
Example of an app's notification categories on the device
OneSignal automatically creates two default categories:
Used when no category is set.
Used when the app is force-quit and reopened, restoring previous notifications that were cleared.
If you always send push notifications with a custom category, the “Miscellaneous” channel won’t appear on user devices. The “Restored” channel will always appear to handle restored notifications after force-closing.
On Huawei devices, OneSignal does not set a default category. If you don’t include one, Huawei will apply High importance by default.
Where to add Android categories in OneSignal
You’ll be asked to define the following:
User-visible. Keep it clear and descriptive.
User-visible. Briefly explain the type of notifications this category will handle.
Controls how visible and interruptive the notification is:
alert_beep
(not alert_beep.wav
)0, 300, 500, 300
→ Wait 0ms, vibrate 300ms, pause 500ms, vibrate 300ms.Some Android devices support LED indicators:
FF0000FF
for blue)Shows badge count on app icon:
Once your category is created, you can use it in your notifications.
After a device receives a notification from a category, Android locks that category’s behavior. Changes to importance, sound, vibration, or other settings will not apply retroactively.
Options:
You can update:
These will update in Android’s notification settings when the next notification is received using that updated channel.
To remove a deleted category from the user’s device:
The SDK will re-sync and remove the deleted category from Android settings.
Use the android_channel_id
in the Create message API request.
Find the Channel ID in the Android Category setup screen
If using your own Android-defined channels, use existing_android_channel_id
instead.
Application
class, not an Activity
. See Android SDK Setup.No. OneSignal does not set setBypassDnd
on categories. To override DND, create your own channel programmatically and enable this setting. See setBypassDnd.
No. OneSignal does not support multiple languages for categories. To support localization, define your own Android channels and reference them via existing_android_channel_id
in your push API requests.